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 r.david.murray
Recipients amaury.forgeotdarc, barry, docs@python, eric.smith, lemburg, lukasz.langa, r.david.murray
Date 2010-11-12.00:15:25
SpamBayes Score 1.1345508e-09
Marked as misclassified No
Message-id <>
Well, the distinction is that, before the bug fix that caused your issue, the 'format_string' method would use a regex to extract the % specifiers from the input string, and call 'format' to replace that % specifier with a properly localized result string.  That is, 'format' was designed to handle a single % specifier with no extra text, basically as a helper method for format_string.  The fact that it didn't reject extra text was, according to an internal comment, a defect of the implementation.  (Passing any extra text would cause the implementation to fail to do the internationalization that was the entire reason for calling it.)

When I fixed the bug I extracted the 'replace a single % specifier' code into an internal method, and made the format method live up to what I perceived to be its documented interface by rejecting extra input characters so that it could safely call the new internal substitution routine.

Now, from the perspective of a *user* of the locale module, I fail to see the point in having both 'format' and 'format_string' exposed.  If you want to format a single % specifier, just pass it to format_string.  Thus my suggestion to make them both do the same thing (to cater to other code that may be calling format incorrectly) and then deprecate one of them (presumably format).  

To bad I didn't think of that when I fixed the original bug.
Date User Action Args
2010-11-12 00:15:26r.david.murraysetrecipients: + r.david.murray, lemburg, barry, amaury.forgeotdarc, eric.smith, docs@python, lukasz.langa
2010-11-12 00:15:26r.david.murraysetmessageid: <>
2010-11-12 00:15:25r.david.murraylinkissue10379 messages
2010-11-12 00:15:25r.david.murraycreate