Description Bug report
.. classmethod :: Signature.from_callable(obj, *, follow_wrapped=True, globalns=None, localns=None)
Return a :class: `Signature ` (or its subclass) object for a given callable
``obj ``. Pass ``follow_wrapped=False `` to get a signature of ``obj ``
without unwrapping its ``__wrapped__ `` chain. ``globalns `` and
``localns `` will be used as the namespaces when resolving annotations.
This method simplifies subclassing of :class: `Signature `::
class MySignature(Signature):
pass
sig = MySignature.from_callable(min)
assert isinstance(sig, MySignature)
Its behavior is otherwise identical to that of :func: `signature `.
.. versionadded :: 3.5
.. versionadded :: 3.10
``globalns `` and ``localns `` parameters.
It has several problems:
Two .. versionadded entries, one should be .. versionchanged instead
eval_str is missing from the signature, here how it looks on 3.10+: https://github.com/python/cpython/blob/3.10/Lib/inspect.py#L2998C1-L3002
eval_str is not documented
Linked PRs
Reactions are currently unavailable
You can’t perform that action at this time.
Bug report
cpython/Doc/library/inspect.rst
Lines 755 to 775 in fef6fb8
It has several problems:
.. versionaddedentries, one should be.. versionchangedinsteadeval_stris missing from the signature, here how it looks on 3.10+: https://github.com/python/cpython/blob/3.10/Lib/inspect.py#L2998C1-L3002eval_stris not documentedLinked PRs
inspect.signatureandSignature.from_callable#112317inspect.signatureandSignature.from_callable(#112317) #112629inspect.signatureandSignature.from_callable(#112317) #112630inspect.signatureandinspect.Signature#112631inspect.signatureandinspect.Signature(#112631) #112649inspect.signatureandinspect.Signature(GH-112631) (GH-112649) #112652