Message212591
OK, I see.
I'd recommend you to take a look how inspect.signature is implemented in 3.3 or 3.4 (and maybe backport it to python 2 and use the new API).
To quickly fix your code, I'd suggest the following modifications:
_WrapperDescriptor = type(type.__call__)
_MethodWrapper = type(all.__call__)
_ClassMethodWrapper = type(int.__dict__['from_bytes'])
def get_callable_argspec(fn):
if inspect.isfunction(fn) or inspect.ismethod(fn):
inspectable = fn
elif inspect.isclass(fn):
inspectable = fn.__init__
elif hasattr(fn, '__call__'):
inspectable = fn.__call__
else:
inspectable = fn
if isinstance(fn, (_WrapperDescriptor, _MethodWrapper, _ClassMethodWrapper)):
raise ValueError('unsupported callable {!r}'.format(fn))
try:
return inspect.getargspec(inspectable)
except TypeError:
raise
I'm closing this issue, as there is no real bug or regression in getargspec. |
|
Date |
User |
Action |
Args |
2014-03-02 21:17:12 | yselivanov | set | recipients:
+ yselivanov, ncoghlan, larry, Arfrever, zzzeek |
2014-03-02 21:17:12 | yselivanov | set | messageid: <1393795032.13.0.521808657584.issue20828@psf.upfronthosting.co.za> |
2014-03-02 21:17:12 | yselivanov | link | issue20828 messages |
2014-03-02 21:17:11 | yselivanov | create | |
|