summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/inspect.rst9
-rw-r--r--Doc/whatsnew/3.4.rst3
2 files changed, 9 insertions, 3 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 0a3a571..91d8831 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -510,9 +510,8 @@ function.
.. attribute:: Parameter.name
- The name of the parameter as a string. Must be a valid python identifier
- name (with the exception of ``POSITIONAL_ONLY`` parameters, which can have
- it set to ``None``).
+ The name of the parameter as a string. The name must be a valid
+ Python identifier.
.. attribute:: Parameter.default
@@ -596,6 +595,10 @@ function.
>>> str(param.replace(default=Parameter.empty, annotation='spam'))
"foo:'spam'"
+ .. versionchanged:: 3.4
+ In Python 3.3 Parameter objects were allowed to have ``name`` set
+ to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``.
+ This is no longer permitted.
.. class:: BoundArguments
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
index 1d88965..4718339 100644
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -1488,6 +1488,9 @@ removed:
* Support for loading the deprecated ``TYPE_INT64`` has been removed from
:mod:`marshal`. (Contributed by Dan Riti in :issue:`15480`.)
+* :class:`inspect.Signature`: positional-only parameters are now required
+ to have a valid name.
+
Code Cleanups
-------------