The endless 460020 bug.

Disable t[:], t*0, t*1 optimizations when t is of a tuple subclass type.
This commit is contained in:
Tim Peters 2001-09-11 19:48:03 +00:00
parent f0b0f680fe
commit 7b07a41e9f
2 changed files with 18 additions and 6 deletions

View file

@ -1417,9 +1417,18 @@ def inherits():
a = madtuple((1,2,3,4,5))
verify(tuple(a) == (1,2,3,4,5))
verify(tuple(a).__class__ is tuple)
verify(a[:].__class__ is tuple)
verify((a * 1).__class__ is tuple)
verify((a * 0).__class__ is tuple)
verify((a + ()).__class__ is tuple)
a = madtuple(())
verify(tuple(a) == ())
verify(tuple(a).__class__ is tuple)
verify((a + a).__class__ is tuple)
verify((a * 0).__class__ is tuple)
verify((a * 1).__class__ is tuple)
verify((a * 2).__class__ is tuple)
verify(a[:].__class__ is tuple)
class madstring(str):
_rev = None