mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #19611: handle implicit parameters in inspect.signature
inspect.signature now reports the implicit ``.0`` parameters generated by the compiler for comprehension and generator expression scopes as if they were positional-only parameters called ``implicit0``. Patch by Jelle Zijlstra.
This commit is contained in:
parent
d62548afed
commit
b4b966ece2
5 changed files with 56 additions and 0 deletions
|
|
@ -625,6 +625,16 @@ function.
|
|||
The name of the parameter as a string. The name must be a valid
|
||||
Python identifier.
|
||||
|
||||
.. impl-detail::
|
||||
|
||||
CPython generates implicit parameter names of the form ``.0`` on the
|
||||
code objects used to implement comprehensions and generator
|
||||
expressions.
|
||||
|
||||
.. versionchanged:: 3.6
|
||||
These parameter names are exposed by this module as names like
|
||||
``implicit0``.
|
||||
|
||||
.. attribute:: Parameter.default
|
||||
|
||||
The default value for the parameter. If the parameter has no default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue