diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-15 22:45:20 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-16 03:46:01 +0200 |
commit | f2b796e7c76e43b10258b6a87bd84884fa879984 (patch) | |
tree | dfedcd2c86e0566b9bde4df9ad38fa17d4cdbd93 /tests | |
parent | b99d9ea25830b4b2e384c180012ee0ddc23f1316 (diff) |
str.format: Don't assume that '}' immediately follows '{', skip insides.
That at least makes stuff like "{:x}".format(1) to produce not completely
broken output.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/tests/string-format.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basics/tests/string-format.py b/tests/basics/tests/string-format.py new file mode 100644 index 000000000..ba51e0890 --- /dev/null +++ b/tests/basics/tests/string-format.py @@ -0,0 +1,8 @@ +print("{}-{}".format(1, [4, 5])) +print("{0}-{1}".format(1, [4, 5])) +print("{:x}".format(1)) +print("{!r}".format(2)) +# TODO +#print("{1}-{0}".format(1, [4, 5])) +#print("{:x}".format(0x10)) +#print("{!r}".format("foo")) |