mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
The endless 460020 bug.
Disable t[:], t*0, t*1 optimizations when t is of a tuple subclass type.
This commit is contained in:
parent
f0b0f680fe
commit
7b07a41e9f
2 changed files with 18 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue