[issue17373] Add inspect.Signature.from_callable()

2014-03-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8a4e44473fdd by Yury Selivanov in branch 'default': inspect.Signature: Add 'Signature.from_callable' classmethod. Closes #17373 http://hg.python.org/cpython/rev/8a4e44473fdd -- nosy: +python-dev resolution: - fixed stage: patch review -

[issue17373] Add inspect.Signature.from_callable()

2014-03-27 Thread Eric Snow
Eric Snow added the comment: Thanks, Yury! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17373 ___ ___ Python-bugs-list mailing list

[issue17373] Add inspect.Signature.from_callable()

2014-02-24 Thread Yury Selivanov
Changes by Yury Selivanov yselivanov...@gmail.com: -- assignee: - yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17373 ___ ___

[issue17373] Add inspect.Signature.from_callable()

2014-01-23 Thread Yury Selivanov
Changes by Yury Selivanov yselivanov...@gmail.com: -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17373 ___

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Eric Snow
Eric Snow added the comment: The difference is that inspect.signature is not friendly to Signature subclasses. Without from_callable you can't customize the behavior in inspect.signature easily. -- ___ Python tracker rep...@bugs.python.org

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Yury Selivanov
Yury Selivanov added the comment: The difference is that inspect.signature is not friendly to Signature subclasses. Without from_callable you can't customize the behavior in inspect.signature easily. OK, suppose you have Signature.from_callable. You then create a subclass MySignature, and

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Yury Selivanov
Yury Selivanov added the comment: Eric, Moreover, 'Signature.from_function' and newly added 'Signature.from_builtin' are private API, or implementation detail (they are not part of PEP, not mentioned in the docs). If at some point it is needed to rewrite Signature in C, probably those two

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Eric Snow
Eric Snow added the comment: It's not about customizing inspect.signature. It's about customizing the nice behavior of that function, including what type it returns. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17373

[issue17373] Add inspect.Signature.from_callable()

2014-01-12 Thread Yury Selivanov
Yury Selivanov added the comment: OK, got it now. Green light from me. Looking through the code, I saw that 'from_builtin' doesn't use the 'Signature._parameter_cls' (as in from_function). That's probably needs to be fixed as well, maybe in a separate issue. --

[issue17373] Add inspect.Signature.from_callable()

2014-01-11 Thread Yury Selivanov
Yury Selivanov added the comment: Hi Eric, I'm not sure why do you want this. Having Signature.from_callable does not allow you to change behaviour of 'inspect.signature' function. More over, it creates a confusion about what API should be used - 'inspect.signature' or

[issue17373] Add inspect.Signature.from_callable()

2013-03-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree in general, but you need to update the docs also. -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17373 ___

[issue17373] Add inspect.Signature.from_callable()

2013-03-06 Thread Eric Snow
New submission from Eric Snow: While working on a subclass of inspect.Signature, I realized that inspect.signature is treated as the constructor. So subclassing isn't so simple. At first I considered adding an extra parameter to inspect.signature allowing different Signature classes. Not