More bug 460020. Disable a number of long optimizations for long subclasses.
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index a50785f..11a3a5d 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1389,6 +1389,30 @@
a = octlong(12345)
verify(long(a) == 12345L)
verify(long(a).__class__ is long)
+ verify((+a).__class__ is long)
+ verify((-a).__class__ is long)
+ verify((-octlong(0)).__class__ is long)
+ verify((a >> 0).__class__ is long)
+ verify((a << 0).__class__ is long)
+ verify((a - 0).__class__ is long)
+ verify((a * 1).__class__ is long)
+ verify((a ** 1).__class__ is long)
+ verify((a // 1).__class__ is long)
+ verify((1 * a).__class__ is long)
+ verify((a | 0).__class__ is long)
+ verify((a ^ 0).__class__ is long)
+ verify((a & -1L).__class__ is long)
+ verify((octlong(0) << 12).__class__ is long)
+ verify((octlong(0) >> 12).__class__ is long)
+ verify(abs(octlong(0)).__class__ is long)
+
+ # Because octlong overrides __add__, we can't check the absence of +0
+ # optimizations using octlong.
+ class longclone(long):
+ pass
+ a = longclone(1)
+ verify((a + 0).__class__ is long)
+ verify((0 + a).__class__ is long)
class precfloat(float):
__slots__ = ['prec']