New submission from Alex Leone <acle...@gmail.com>:

When using the '#' to prefix a numeric argument in format() with a '0x' or 
others, the 0-width padding takes into account the '0x' characters.  This is 
unexpected - the 0-width should NOT take into account the prefix.

Current Behavior:
> "{0:#02x}".format(10)
'0xa'

Expected Output:
> "{0:#02x}".format(10)
'0x0a'

(note that the '0a' is two characters long, as it should be)

----------
components: Library (Lib)
messages: 123441
nosy: Alex.Leone
priority: normal
severity: normal
status: open
title: string.format() Unexpected output with numeric '#' prefix and 0 width
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10633>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to