This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients LambertDW, eric.smith, ezio.melotti, gvanrossum, mark.dickinson, ncoghlan, orsenthil, pitrou, terry.reedy
Date 2009-03-10.09:34:14
SpamBayes Score 3.6102565e-11
Marked as misclassified No
Message-id <1236677662.55.0.235079435171.issue5237@psf.upfronthosting.co.za>
In-reply-to
Content
It may also be worth explicitly stating the following in the docs: "Note
that automatically numbered and explcitly namged/numbered replacement
fields cannot be mixed in a single format string". (This could probably
be relegated to a footnote).

This proposal is also significantly better defined than the rather
bizarre behaviour seen in the equivalent situation with %-formatting:

>>> "%s %(name)s" % dict(name="Hmm")
"{'name': 'Hmm'} Hmm"

>>> "%s %(name)s %s" % dict(name="Hmm")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string

>>> "%s %(name)s %s" % (dict(name="Hmm"), "dodgy")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: format requires a mapping
History
Date User Action Args
2009-03-10 09:34:22ncoghlansetrecipients: + ncoghlan, gvanrossum, terry.reedy, mark.dickinson, orsenthil, pitrou, eric.smith, LambertDW, ezio.melotti
2009-03-10 09:34:22ncoghlansetmessageid: <1236677662.55.0.235079435171.issue5237@psf.upfronthosting.co.za>
2009-03-10 09:34:15ncoghlanlinkissue5237 messages
2009-03-10 09:34:15ncoghlancreate