]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111999: Fix the signature of str.format_map() (#119540)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 25 May 2024 13:21:11 +0000 (16:21 +0300)
committerGitHub <noreply@github.com>
Sat, 25 May 2024 13:21:11 +0000 (06:21 -0700)
Doc/library/stdtypes.rst
Misc/NEWS.d/next/Core and Builtins/2024-05-25-13-51-48.gh-issue-111999.L0q1gh.rst [new file with mode: 0644]
Objects/unicodeobject.c

index c0a3d0b3a2a49e5780860325479af92c5c7db1a4..c8acde8b57dcdb8ab2dda45ed6923fc4e6c49480 100644 (file)
@@ -1768,7 +1768,7 @@ expression support in the :mod:`re` module).
       cases.
 
 
-.. method:: str.format_map(mapping)
+.. method:: str.format_map(mapping, /)
 
    Similar to ``str.format(**mapping)``, except that ``mapping`` is
    used directly and not copied to a :class:`dict`.  This is useful
diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-05-25-13-51-48.gh-issue-111999.L0q1gh.rst b/Misc/NEWS.d/next/Core and Builtins/2024-05-25-13-51-48.gh-issue-111999.L0q1gh.rst
new file mode 100644 (file)
index 0000000..4b1ca6c
--- /dev/null
@@ -0,0 +1 @@
+Fix the signature of :meth:`str.format_map`.
index afff37467caf3220c773b2d970a5d27e400a9154..048f9a814c30af19ab418f5fd523ce5931b591e9 100644 (file)
@@ -13490,7 +13490,7 @@ Return a formatted version of the string, using substitutions from args and kwar
 The substitutions are identified by braces ('{' and '}').");
 
 PyDoc_STRVAR(format_map__doc__,
-             "format_map($self, /, mapping)\n\
+             "format_map($self, mapping, /)\n\
 --\n\
 \n\
 Return a formatted version of the string, using substitutions from mapping.\n\