Yury Selivanov added the comment: 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. ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20828> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com