From: Raymond Hettinger Date: Thu, 28 Mar 2019 04:03:02 +0000 (-0700) Subject: Revert "Minor doc improvement (GH-10341)" (GH-12597) X-Git-Tag: v3.8.0a4~314 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb28fcc9252da51001b98cd93d65fb0e9b43aa3e;p=thirdparty%2FPython%2Fcpython.git Revert "Minor doc improvement (GH-10341)" (GH-12597) This reverts commit dfd775a0b1aee51d842b20cdebd97cc52c0b32e7. --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 8d53e6879ef8..64de970fec94 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -971,7 +971,7 @@ function: >>> getattr(p, 'x') 11 -To convert a dictionary to a named tuple, use the ``**`` operator +To convert a dictionary to a named tuple, use the double-star-operator (as described in :ref:`tut-unpacking-arguments`): >>> d = {'x': 11, 'y': 22} diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index abf163d232c5..905734539c68 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -560,7 +560,7 @@ The reverse situation occurs when the arguments are already in a list or tuple but need to be unpacked for a function call requiring separate positional arguments. For instance, the built-in :func:`range` function expects separate *start* and *stop* arguments. If they are not available separately, write the -function call with the ``*`` operator to unpack the arguments out of a list +function call with the ``*``\ -operator to unpack the arguments out of a list or tuple:: >>> list(range(3, 6)) # normal call with separate arguments @@ -573,7 +573,7 @@ or tuple:: single: **; in function calls In the same fashion, dictionaries can deliver keyword arguments with the -``**`` operator:: +``**``\ -operator:: >>> def parrot(voltage, state='a stiff', action='voom'): ... print("-- This parrot wouldn't", action, end=' ')