[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

Larry Hastings report at bugs.python.org
Mon Jan 20 00:36:58 CET 2014


Larry Hastings added the comment:

inspect.signature(object) works fine in my (not yet posted) latest #20189 patch.

inspect.signature(type) doesn't work, because it's not clear what the signature for type should be.  There's the one-argument and three-argument approaches.  This is technically true:

    "(object_or_name, [bases, dict])"

However,
a) it's painful to look at,
b) I can't communicate the idea of an "optional group" in an inspect.Signature object right now (although I guess we're going to hash that out somewhere, which is good).

If we can agree on a good signature for inspect.signature(type), I can make it happen.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20308>
_______________________________________


More information about the Python-bugs-list mailing list