Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f77e96e commit b51ae20Copy full SHA for b51ae20
extra_tests/snippets/fstrings.py
@@ -47,6 +47,15 @@
47
spec = "0>+#10x"
48
assert f"{16:{spec}}{foo}" == '00000+0x10bar'
49
50
+part_spec = ">+#10x"
51
+assert f"{16:0{part_spec}}{foo}" == '00000+0x10bar'
52
+
53
+# TODO: RUSTPYTHON, delete the next block once `test_fstring.py` can successfully parse
54
+assert f'{10:#{1}0x}' == ' 0xa'
55
+assert f'{10:{"#"}1{0}{"x"}}' == ' 0xa'
56
+assert f'{-10:-{"#"}1{0}x}' == ' -0xa'
57
+assert f'{-10:{"-"}#{1}0{"x"}}' == ' -0xa'
58
59
# TODO:
60
# spec = "bla"
61
# assert_raises(ValueError, lambda: f"{16:{spec}}")
0 commit comments