diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2019-03-10 11:30:11 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2019-03-10 11:30:11 (GMT) |
commit | 1aeeaeb79efa4de41f97b58547e23c2965ecabc5 (patch) | |
tree | 1150b1531a70f0df3de6090231b18b0715fbe087 /Doc/library | |
parent | 11205b80309a01666eefee2301a244aa73a4c450 (diff) | |
download | cpython-1aeeaeb79efa4de41f97b58547e23c2965ecabc5.zip cpython-1aeeaeb79efa4de41f97b58547e23c2965ecabc5.tar.gz cpython-1aeeaeb79efa4de41f97b58547e23c2965ecabc5.tar.bz2 |
bpo-21314: Add a FAQ entry about positional only parameters (GH-10641)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/functions.rst | 5 | ||||
-rw-r--r-- | Doc/library/inspect.rst | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index ebbee71..ae0c9fb 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -669,6 +669,11 @@ are always available. They are listed here in alphabetical order. topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated. + Note that if a slash(/) appears in the parameter list of a function, when + invoking :func:`help`, it means that the parameters prior to the slash are + positional-only. For more info, see + :ref:`the FAQ entry on positional-only parameters <faq-positional-only-arguments>`. + This function is added to the built-in namespace by the :mod:`site` module. .. versionchanged:: 3.4 diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index dfd78a9..81824dd 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -572,6 +572,10 @@ function. Raises :exc:`ValueError` if no signature can be provided, and :exc:`TypeError` if that type of object is not supported. + A slash(/) in the signature of a function denotes that the parameters prior + to it are positional-only. For more info, see + :ref:`the FAQ entry on positional-only parameters <faq-positional-only-arguments>`. + .. versionadded:: 3.5 ``follow_wrapped`` parameter. Pass ``False`` to get a signature of ``callable`` specifically (``callable.__wrapped__`` will not be used to |