]> granicus.if.org Git - python/commitdiff
Document that format string don’t support arbitrary dictonary keys.
authorÉric Araujo <merwok@netwok.org>
Thu, 1 Sep 2011 17:57:01 +0000 (19:57 +0200)
committerÉric Araujo <merwok@netwok.org>
Thu, 1 Sep 2011 17:57:01 +0000 (19:57 +0200)
Text adapted from the PEP.  Addition requested by Terry J. Reedy on
2011-02-23 on python-dev.

Doc/library/string.rst

index 9ee81b596cb31b09cdbc69c1c3291e0b70b2e221..20fcae97739f7764324cef84ac28800a1426839a 100644 (file)
@@ -248,6 +248,8 @@ keyword.  If it's a number, it refers to a positional argument, and if it's a ke
 it refers to a named keyword argument.  If the numerical arg_names in a format string
 are 0, 1, 2, ... in sequence, they can all be omitted (not just some)
 and the numbers 0, 1, 2, ... will be automatically inserted in that order.
+Because *arg_name* is not quote-delimited, it is not possible to specify arbitrary
+dictionary keys (e.g., the strings ``'10'`` or ``':-]'``) within a format string.
 The *arg_name* can be followed by any number of index or
 attribute expressions. An expression of the form ``'.name'`` selects the named
 attribute using :func:`getattr`, while an expression of the form ``'[index]'``