diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-01-27 20:07:58 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-01-27 20:07:58 (GMT) |
commit | 2393dca4721b308704f3bc8c8791b06062daa7e3 (patch) | |
tree | b9cdf7b2ef09e455b512f7a4d993942e4409eda2 /Doc | |
parent | ea2d66e68a6901d886e17ab56f98299dbd65150a (diff) | |
download | cpython-2393dca4721b308704f3bc8c8791b06062daa7e3.zip cpython-2393dca4721b308704f3bc8c8791b06062daa7e3.tar.gz cpython-2393dca4721b308704f3bc8c8791b06062daa7e3.tar.bz2 |
inspect.signature: Use '/' to separate positional-only parameters from
the rest in Signature.__str__. #20356
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/inspect.rst | 9 | ||||
-rw-r--r-- | Doc/whatsnew/3.4.rst | 3 |
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 ------------- |