summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-11-29 23:52:13 (GMT)
committerGuido van Rossum <guido@python.org>2003-11-29 23:52:13 (GMT)
commit6c9e130524533263b690e86639a36b6f3e7a8eeb (patch)
tree39023f825688f630245ddcaa60af9942a859522c /Lib/test/test_builtin.py
parent37e136373e0d9ab3bdf25ecd9c42b86281ed21d3 (diff)
downloadcpython-6c9e130524533263b690e86639a36b6f3e7a8eeb.zip
cpython-6c9e130524533263b690e86639a36b6f3e7a8eeb.tar.gz
cpython-6c9e130524533263b690e86639a36b6f3e7a8eeb.tar.bz2
- Removed FutureWarnings related to hex/oct literals and conversions
and left shifts. (Thanks to Kalle Svensson for SF patch 849227.) This addresses most of the remaining semantic changes promised by PEP 237, except for repr() of a long, which still shows the trailing 'L'. The PEP appears to promise warnings for operations that changed semantics compared to Python 2.3, but this is not implemented; we've suffered through enough warnings related to hex/oct literals and I think it's best to be silent now.
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index d47a9da..1953f29 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -437,8 +437,7 @@ class BuiltinTest(unittest.TestCase):
def test_hex(self):
self.assertEqual(hex(16), '0x10')
self.assertEqual(hex(16L), '0x10L')
- self.assertEqual(len(hex(-1)), len(hex(sys.maxint)))
- self.assert_(hex(-16) in ('0xfffffff0', '0xfffffffffffffff0'))
+ self.assertEqual(hex(-16), '-0x10')
self.assertEqual(hex(-16L), '-0x10L')
self.assertRaises(TypeError, hex, {})
@@ -757,7 +756,7 @@ class BuiltinTest(unittest.TestCase):
def test_oct(self):
self.assertEqual(oct(100), '0144')
self.assertEqual(oct(100L), '0144L')
- self.assert_(oct(-100) in ('037777777634', '01777777777777777777634'))
+ self.assertEqual(oct(-100), '-0144')
self.assertEqual(oct(-100L), '-0144L')
self.assertRaises(TypeError, oct, ())