py: Remove unnecessary extra handling of padding of nan/inf.

C's printf will pad nan/inf differently to CPython.  Our implementation
originally conformed to C, now it conforms to CPython's way.

Tests for this are also added in this patch.
This commit is contained in:
Damien George
2015-05-28 14:22:12 +00:00
parent 2cae0f6290
commit 79474c6b16
5 changed files with 12 additions and 16 deletions

View File

@@ -23,6 +23,10 @@ test("{:10.4F}", -123.456)
test("{:10.4G}", 123.456)
test("{:10.4G}", -123.456)
test("{:06e}", float("inf"))
test("{:06e}", float("-inf"))
test("{:06e}", float("nan"))
# The following fails right now
#test("{:10.1}", 0.0)