We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent800d0f9 commitc8c5abeCopy full SHA for c8c5abe
extra_tests/snippets/builtin_format.py
@@ -33,3 +33,13 @@ def test_zero_padding():
33
assertf"{0x1f5a5:c}"=="🖥"
34
assert_raises(ValueError,"{:+c}".format,1,_msg="Sign not allowed with integer format specifier 'c'")
35
assert_raises(ValueError,"{:#c}".format,1,_msg="Alternate form (#) not allowed with integer format specifier 'c'")
36
+assertf"{256:#010x}"=="0x00000100"
37
+assertf"{256:0=#10x}"=="0x00000100"
38
+assertf"{256:0>#10x}"=="000000x100"
39
+assertf"{256:0^#10x}"=="000x100000"
40
+assertf"{256:0<#10x}"=="0x10000000"
41
+assertf"{512:+#010x}"=="+0x0000200"
42
+assertf"{512:0=+#10x}"=="+0x0000200"
43
+assertf"{512:0>+#10x}"=="0000+0x200"
44
+assertf"{512:0^+#10x}"=="00+0x20000"
45
+assertf"{512:0<+#10x}"=="+0x2000000"