summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-15 16:59:06 (GMT)
committerGuido van Rossum <guido@python.org>2007-01-15 16:59:06 (GMT)
commite2a383d062434c05b73031f0da57fe82b9da8942 (patch)
tree1a6fb6b2c056a10ee227dbc75855b3fac6153414 /Lib/test/test_format.py
parentfc7bb8c786fd9cb3b1ab84e1976620d0ab545777 (diff)
downloadcpython-e2a383d062434c05b73031f0da57fe82b9da8942.zip
cpython-e2a383d062434c05b73031f0da57fe82b9da8942.tar.gz
cpython-e2a383d062434c05b73031f0da57fe82b9da8942.tar.bz2
Rip out 'long' and 'L'-suffixed integer literals.
(Rough first cut.)
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index fc8a5a1..df78a32 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -57,14 +57,14 @@ testboth('%12.*f', (123456, 1.0))
# Formatting of long integers. Overflow is not ok
overflowok = 0
-testboth("%x", 10L, "a")
-testboth("%x", 100000000000L, "174876e800")
-testboth("%o", 10L, "12")
-testboth("%o", 100000000000L, "1351035564000")
-testboth("%d", 10L, "10")
-testboth("%d", 100000000000L, "100000000000")
-
-big = 123456789012345678901234567890L
+testboth("%x", 10, "a")
+testboth("%x", 100000000000, "174876e800")
+testboth("%o", 10, "12")
+testboth("%o", 100000000000, "1351035564000")
+testboth("%d", 10, "10")
+testboth("%d", 100000000000, "100000000000")
+
+big = 123456789012345678901234567890
testboth("%d", big, "123456789012345678901234567890")
testboth("%d", -big, "-123456789012345678901234567890")
testboth("%5d", -big, "-123456789012345678901234567890")
@@ -83,7 +83,7 @@ testboth("%.30d", big, "123456789012345678901234567890")
testboth("%.31d", big, "0123456789012345678901234567890")
testboth("%32.31d", big, " 0123456789012345678901234567890")
-big = 0x1234567890abcdef12345L # 21 hex digits
+big = 0x1234567890abcdef12345 # 21 hex digits
testboth("%x", big, "1234567890abcdef12345")
testboth("%x", -big, "-1234567890abcdef12345")
testboth("%5x", -big, "-1234567890abcdef12345")
@@ -120,7 +120,7 @@ testboth("%#+027.23X", big, "+0X0001234567890ABCDEF12345")
# same, except no 0 flag
testboth("%#+27.23X", big, " +0X001234567890ABCDEF12345")
-big = 012345670123456701234567012345670L # 32 octal digits
+big = 012345670123456701234567012345670 # 32 octal digits
testboth("%o", big, "12345670123456701234567012345670")
testboth("%o", -big, "-12345670123456701234567012345670")
testboth("%5o", -big, "-12345670123456701234567012345670")
@@ -163,34 +163,34 @@ testboth("%0#34.33o", big, "0012345670123456701234567012345670")
# Some small ints, in both Python int and long flavors).
testboth("%d", 42, "42")
testboth("%d", -42, "-42")
-testboth("%d", 42L, "42")
-testboth("%d", -42L, "-42")
+testboth("%d", 42, "42")
+testboth("%d", -42, "-42")
testboth("%#x", 1, "0x1")
-testboth("%#x", 1L, "0x1")
+testboth("%#x", 1, "0x1")
+testboth("%#X", 1, "0X1")
testboth("%#X", 1, "0X1")
-testboth("%#X", 1L, "0X1")
testboth("%#o", 1, "01")
-testboth("%#o", 1L, "01")
+testboth("%#o", 1, "01")
+testboth("%#o", 0, "0")
testboth("%#o", 0, "0")
-testboth("%#o", 0L, "0")
testboth("%o", 0, "0")
-testboth("%o", 0L, "0")
+testboth("%o", 0, "0")
testboth("%d", 0, "0")
-testboth("%d", 0L, "0")
+testboth("%d", 0, "0")
+testboth("%#x", 0, "0x0")
testboth("%#x", 0, "0x0")
-testboth("%#x", 0L, "0x0")
testboth("%#X", 0, "0X0")
-testboth("%#X", 0L, "0X0")
+testboth("%#X", 0, "0X0")
testboth("%x", 0x42, "42")
testboth("%x", -0x42, "-42")
-testboth("%x", 0x42L, "42")
-testboth("%x", -0x42L, "-42")
+testboth("%x", 0x42, "42")
+testboth("%x", -0x42, "-42")
testboth("%o", 042, "42")
testboth("%o", -042, "-42")
-testboth("%o", 042L, "42")
-testboth("%o", -042L, "-42")
+testboth("%o", 042, "42")
+testboth("%o", -042, "-42")
# Test exception for unknown format characters
if verbose:
@@ -230,7 +230,7 @@ test_exc(u'no format', '1', TypeError,
test_exc(u'no format', u'1', TypeError,
"not all arguments converted during string formatting")
-class Foobar(long):
+class Foobar(int):
def __oct__(self):
# Returning a non-string should not blow up.
return self + 1