Closed smurfix closed 8 years ago
This problem is hard to solve, since a coroutine is also a callable :(
With Python 3.4 it's possible to set function._is_coroutine=True
to circumvent the test, but that's undocumented and not particularly future-proof …
Okay. the developper will have a nice error if he does not provide a coroutine :P
@smurfix any though ? Sorry for the API compatibility but removing the check without modifying the method signature didn't have any sense (to me).
pika uses the same style (i.e. self, callback queue="", …) so this is OK with me.
It's not incompatible if the caller habitually uses keyword-only calling conventions. ;-)
This is a spurious error. One might want to use tools like
functools.partial
, or a nested function, to create the callback. Example:Checking for None (or maybe
callable()
) should be sufficient.