From: Yukihiro Matsumoto Date: 2007-07-16T23:52:57+09:00 Subject: Re: sprintf: Format specifier tokens aren't checked well enough Hi, In message "Re: sprintf: Format specifier tokens aren't checked well enough" on Mon, 2 Jul 2007 05:20:31 +0900, Florian Gross writes: |Something seems to be broken for %u with negative bignums: Right. |"%u" % -5 # => "..4294967291" Dots do not work well with decimals. Maybe we should either * prohibit negative number for %u * or make %u works as an alias to %d (a la Python) |"%.20u" % -5 # => "..........4294967291" |"%+u" % -5 # => "-5" Since %u specifies "unsigned" it should ignore "+" modifier. |big = -(2 ** 80 + 5) |"%u" % big # => "-79226953588444722964369244155" |"%.50u" % big # => |"....................-79226953588444722964369244155" Dots and negative sign should not co-exist. My 1.8.6 gives ".....................79226953588444722964369244155" which is still wrong though. matz.