cannot pass class-bound method to context call #313
As described by the documentation, I expect to be able to specify as a call target of
However, at least in naively passing the Python object reference of either version of a method, mitogen is either unable to find or unable to process the call target.
For example, using
– results in the following error –
Or, replacing the
In the case of the
– such that mitogen can now find the call target at the module level; (however, if mitogen intends to support static methods, this is less than ideal).
The text was updated successfully, but these errors were encountered:
Yeah this is far from ideal -- actually, I'm not sure how static methods ended up in the docs, they're very hard to disambiguate on Python 2. Let me think about this one -- a proper solution to this is actually quite hard (AST parsing wasn't available in 2.4), but a 3.x-only solution is easily doable at least
No problem, that makes sense to me.
Does this resolve the issue with
Sorry for the delayed response, but the original issue referred to class methods as well:
The issue with class methods is a bit more awkward to work around, since the target callable has an implicit expectation that it will receive the class, after all. That said, it looked more like something that just needed some tweaking, since class-bound methods are more straight-forward to detect, (though I could certainly be missing something).