mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Forward port of r64958.
Added '#' formatting to integers. This adds the 0b, 0o, or 0x prefix for bin, oct, hex. There's still one failing case, and I need to finish the docs. I hope to finish those today.
This commit is contained in:
parent
e840b9ad51
commit
b1ebcc6b0b
3 changed files with 85 additions and 13 deletions
|
@ -700,6 +700,10 @@ class UnicodeTest(
|
|||
self.assertRaises(ValueError, format, "", "-")
|
||||
self.assertRaises(ValueError, "{0:=s}".format, '')
|
||||
|
||||
# Alternate formatting is not supported
|
||||
self.assertRaises(ValueError, format, '', '#')
|
||||
self.assertRaises(ValueError, format, '', '#20')
|
||||
|
||||
def test_formatting(self):
|
||||
string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
|
||||
# Testing Unicode formatting strings...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue