Re: [Python-Dev] cpython: inspect.Signature: Add 'Signature.from_callable' classmethod. Closes #17373
On Thu, 27 Mar 2014 17:12:02 +0100 (CET) yury.selivanov <python-checkins@python.org> wrote:
+ .. classmethod:: Signature.from_callable(obj) + + Return a :class:`Signature` (or its subclass) object for a given callable + ``obj``. This method simplifies subclassing of :class:`Signature`: + + :: + + class MySignature(Signature): + pass + sig = MySignature.from_callable(min) + assert isinstance(sig, MySignature) +
This needs a "versionadded" tag. Regards Antoine.
And probably the block should be deindented On Thu, Mar 27, 2014 at 6:48 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
On Thu, 27 Mar 2014 17:12:02 +0100 (CET) yury.selivanov <python-checkins@python.org> wrote:
+ .. classmethod:: Signature.from_callable(obj) + + Return a :class:`Signature` (or its subclass) object for a given callable + ``obj``. This method simplifies subclassing of :class:`Signature`: + + :: + + class MySignature(Signature): + pass + sig = MySignature.from_callable(min) + assert isinstance(sig, MySignature) +
This needs a "versionadded" tag.
Regards
Antoine.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/andrew.svetlov%40gmail.co...
-- Thanks, Andrew Svetlov
Thanks, it's fixed now. Yury On 2014-03-28, 10:29 AM, Andrew Svetlov wrote:
And probably the block should be deindented
On Thu, Mar 27, 2014 at 6:48 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
On Thu, 27 Mar 2014 17:12:02 +0100 (CET) yury.selivanov <python-checkins@python.org> wrote:
+ .. classmethod:: Signature.from_callable(obj) + + Return a :class:`Signature` (or its subclass) object for a given callable + ``obj``. This method simplifies subclassing of :class:`Signature`: + + :: + + class MySignature(Signature): + pass + sig = MySignature.from_callable(min) + assert isinstance(sig, MySignature) + This needs a "versionadded" tag.
Regards
Antoine.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/andrew.svetlov%40gmail.co...
participants (3)
-
Andrew Svetlov -
Antoine Pitrou -
Yury Selivanov