8000 Add initial 'whatsnew' section for PEP 570 (GH-12942) · python/cpython@843bf42 · GitHub
[go: up one dir, main page]

Skip to content

Commit 843bf42

Browse files
gvanrossumpablogsal
authored andcommitted
Add initial 'whatsnew' section for PEP 570 (GH-12942)
1 parent 8c77b8c commit 843bf42

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,31 @@ See :pep:`572` for a full description.
8383
.. TODO: Emily will sprint on docs at PyCon US 2019.
8484
8585
86+
Positional-only parameters
87+
--------------------------
88+
89+
There is new syntax (``/``) to indicate that some function parameters
90+
must be specified positionally (i.e., cannot be used as keyword
91+
arguments). This is the same notation as shown by ``help()`` for
92+
functions implemented in C (produced by Larry Hastings' "Argument
93+
Clinic" tool). Example::
94+
95+
def pow(x, y, z=None, /):
96+
r = x**y
97+
if z is not None:
98+
r %= z
99+
return r
100+
101+
Now ``pow(2, 10)`` and ``pow(2, 10, 17)`` are valid calls, but
102+
``pow(x=2, y=10)`` and ``pow(2, 10, z=17)`` are invalid.
103+
104+
See :pep:`570` for a full description.
105+
106+
(Contributed by Pablo Galindo in :issue:`36540`.)
107+
108+
.. TODO: Pablo will sprint on docs at PyCon US 2019.
109+
110+
86111
Parallel filesystem cache for compiled bytecode files
87112
-----------------------------------------------------
88113

0 commit comments

Comments
 (0)
0