diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-05-18 00:56:53 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-05-18 00:56:53 +0200 |
commit | dc2d7d21e2018eadd781e865a78fdaec4c25ff39 (patch) | |
tree | 5747ccc983dcf3cb8073b041e01ca016a9138b26 /Doc/library/inspect.rst | |
parent | 6a67e92bae1638c863093c175a5d0b5e861041f4 (diff) | |
parent | 7e9937e0049e8be220fafdaa208da77e65eccd9f (diff) | |
download | cpython-dc2d7d21e2018eadd781e865a78fdaec4c25ff39.tar.gz |
Issue #21430: additions to the description of non-blocking SSL sockets
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r-- | Doc/library/inspect.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 0c087123e8..21408f4664 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -462,6 +462,9 @@ function. Signature objects are *immutable*. Use :meth:`Signature.replace` to make a modified copy. + .. versionchanged:: 3.5 + Signature objects are picklable and hashable. + .. attribute:: Signature.empty A special class-level marker to specify absence of a return annotation. @@ -506,12 +509,29 @@ function. >>> str(new_sig) "(a, b) -> 'new return anno'" + .. 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) + + .. versionadded:: 3.5 + .. class:: Parameter(name, kind, \*, default=Parameter.empty, annotation=Parameter.empty) Parameter objects are *immutable*. Instead of modifying a Parameter object, you can use :meth:`Parameter.replace` to create a modified copy. + .. versionchanged:: 3.5 + Parameter objects are picklable and hashable. + .. attribute:: Parameter.empty A special class-level marker to specify absence of default values and |