diff options
author | Guido van Rossum <guido@python.org> | 2007-01-15 16:59:06 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-15 16:59:06 (GMT) |
commit | e2a383d062434c05b73031f0da57fe82b9da8942 (patch) | |
tree | 1a6fb6b2c056a10ee227dbc75855b3fac6153414 /Lib/test/test_class.py | |
parent | fc7bb8c786fd9cb3b1ab84e1976620d0ab545777 (diff) | |
download | cpython-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_class.py')
-rw-r--r-- | Lib/test/test_class.py | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 1758fd4..c450c80 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -84,10 +84,6 @@ class AllTests: print "__float__:", args return 1.0 - def __long__(self, *args): - print "__long__:", args - return 1L - def __oct__(self, *args): print "__oct__:", args return '01' @@ -238,7 +234,7 @@ else: +testme abs(testme) int(testme) -long(testme) +int(testme) float(testme) oct(testme) hex(testme) @@ -289,7 +285,6 @@ class BadTypeClass: def __int__(self): return None __float__ = __int__ - __long__ = __int__ __str__ = __int__ __repr__ = __int__ __oct__ = __int__ @@ -307,31 +302,11 @@ def check_exc(stmt, exception): check_exc("int(BadTypeClass())", TypeError) check_exc("float(BadTypeClass())", TypeError) -check_exc("long(BadTypeClass())", TypeError) check_exc("str(BadTypeClass())", TypeError) check_exc("repr(BadTypeClass())", TypeError) check_exc("oct(BadTypeClass())", TypeError) check_exc("hex(BadTypeClass())", TypeError) -# mixing up ints and longs is okay -class IntLongMixClass: - def __int__(self): - return 0L - - def __long__(self): - return 0 - -try: - int(IntLongMixClass()) -except TypeError: - raise TestFailed, "TypeError should not be raised" - -try: - long(IntLongMixClass()) -except TypeError: - raise TestFailed, "TypeError should not be raised" - - # Test correct errors from hash() on objects with comparisons but no __hash__ class C0: |