diff options
author | Larry Hastings <larry@hastings.org> | 2014-05-18 23:15:35 -0700 |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-05-18 23:15:35 -0700 |
commit | cc001283f12f300f7e1c2f4c235273417ccf964f (patch) | |
tree | 5747ccc983dcf3cb8073b041e01ca016a9138b26 /Doc/library/inspect.rst | |
parent | c5f310167168d11805a9d5d15cc743e7092c0b71 (diff) | |
parent | 9c7f094fee7e83e4278abb45524089ad02fa59a7 (diff) | |
download | cpython-cc001283f12f300f7e1c2f4c235273417ccf964f.tar.gz |
Null merge 3.4.1 (and 3.4.1rc1) release-engineering revisions.
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 |