Message12078
This isn't as obviously wrong as it looks at first.
I would say we have followed the convention that no type means "d":
>>> True.__format__("10")
' 1'
>>> True.__format__("<")
'1'
>>> True.__format__("d")
'1'
But we missed the convention that an empty format string ("") produces the same result as if you had called str() on the value.
>>> True.__format__("")
'True'
See: https://docs.python.org/2/library/string.html#format-specification-mini-language
I'm surprised that nothing in the regression tests has caught this, but there just isn't one in the Python suite. So a solution should start with a failing test in (I think) test_format_jy checking this for True and False, and maybe a few where it is 1, 0 for good measure. |
|
Date |
User |
Action |
Args |
2018-08-10 21:10:44 | jeff.allen | set | messageid: <1533935444.22.0.56676864532.issue2691@psf.upfronthosting.co.za> |
2018-08-10 21:10:44 | jeff.allen | set | recipients:
+ jeff.allen, _peter_holloway |
2018-08-10 21:10:44 | jeff.allen | link | issue2691 messages |
2018-08-10 21:10:43 | jeff.allen | create | |
|