Summary: | Python version of text handler example | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Guillaume Desmottes <guillaume.desmottes> |
Component: | tp-glib | Assignee: | Telepathy bugs list <telepathy-bugs> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | enhancement | ||
Priority: | medium | CC: | tomeu |
Version: | unspecified | Keywords: | patch |
Hardware: | Other | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/cassidy/telepathy-glib;a=shortlog;h=refs/heads/python-handler-32524 | ||
Whiteboard: | review+ | ||
i915 platform: | i915 features: | ||
Bug Depends on: | 32465 | ||
Bug Blocks: |
Description
Guillaume Desmottes
2010-12-20 05:50:23 UTC
Oh, Tomeu, I'm not really happy with this: channel.ack_messages_async(messages, lambda a, b, c: 0, None) Is there a better way to pass no callback? Shouldn't pygi always allow None as a GAsyncReadyCallback ? (In reply to comment #2) > Oh, Tomeu, I'm not really happy with this: > channel.ack_messages_async(messages, lambda a, b, c: 0, None) > > Is there a better way to pass no callback? Shouldn't pygi always allow None as > a GAsyncReadyCallback ? We surely could special-case it in pygobject or even in g-i-scanner, so all bindings benefit from it. But I wonder if in some cases API authors would like to make sure it's not None. (In reply to comment #3) > (In reply to comment #2) > > Oh, Tomeu, I'm not really happy with this: > > channel.ack_messages_async(messages, lambda a, b, c: 0, None) > > > > Is there a better way to pass no callback? Shouldn't pygi always allow None as > > a GAsyncReadyCallback ? > > We surely could special-case it in pygobject or even in g-i-scanner, so all > bindings benefit from it. But I wonder if in some cases API authors would like > to make sure it's not None. I think in this case it should be telepathy-glib to add (allow-none) annotations to those arguments, as nobody else can now if that code is ready to handle NULL callbacks. If that doesn't work for some reason, please file a bug for pygobject. (In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > Oh, Tomeu, I'm not really happy with this: > > > channel.ack_messages_async(messages, lambda a, b, c: 0, None) > > > > > > Is there a better way to pass no callback? Shouldn't pygi always allow None as > > > a GAsyncReadyCallback ? > > > > We surely could special-case it in pygobject or even in g-i-scanner, so all > > bindings benefit from it. But I wonder if in some cases API authors would like > > to make sure it's not None. > > I think in this case it should be telepathy-glib to add (allow-none) > annotations to those arguments, as nobody else can now if that code is ready to > handle NULL callbacks. If that doesn't work for some reason, please file a bug > for pygobject. It doesn't work. I opened https://bugzilla.gnome.org/show_bug.cgi?id=640812 I added 2 small commits to the branch. Merged to master; will be in 0.13.12 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.