diff options
author | Guido van Rossum <guido@python.org> | 2019-04-29 12:49:30 (GMT) |
---|---|---|
committer | Pablo Galindo <Pablogsal@gmail.com> | 2019-04-29 12:49:29 (GMT) |
commit | 843bf42aa65aaa25b356e7b3d8733a117b8f01a4 (patch) | |
tree | 563879c940bd4cf9fb87e4a0b9e178d7faeb6391 | |
parent | 8c77b8cb9188165a123f2512026e3629bf03dc9b (diff) | |
download | cpython-843bf42aa65aaa25b356e7b3d8733a117b8f01a4.zip cpython-843bf42aa65aaa25b356e7b3d8733a117b8f01a4.tar.gz cpython-843bf42aa65aaa25b356e7b3d8733a117b8f01a4.tar.bz2 |
Add initial 'whatsnew' section for PEP 570 (GH-12942)
-rw-r--r-- | Doc/whatsnew/3.8.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 90ff72f..225faf8 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -83,6 +83,31 @@ See :pep:`572` for a full description. .. TODO: Emily will sprint on docs at PyCon US 2019. +Positional-only parameters +-------------------------- + +There is new syntax (``/``) to indicate that some function parameters +must be specified positionally (i.e., cannot be used as keyword +arguments). This is the same notation as shown by ``help()`` for +functions implemented in C (produced by Larry Hastings' "Argument +Clinic" tool). Example:: + + def pow(x, y, z=None, /): + r = x**y + if z is not None: + r %= z + return r + +Now ``pow(2, 10)`` and ``pow(2, 10, 17)`` are valid calls, but +``pow(x=2, y=10)`` and ``pow(2, 10, z=17)`` are invalid. + +See :pep:`570` for a full description. + +(Contributed by Pablo Galindo in :issue:`36540`.) + +.. TODO: Pablo will sprint on docs at PyCon US 2019. + + Parallel filesystem cache for compiled bytecode files ----------------------------------------------------- |