More on SF bug [#460020] bug or feature: unicode() and subclasses.

tuple(i) repaired to return a true tuple when i is an instance of a
tuple subclass.
Added PyTuple_CheckExact macro.
PySequence_Tuple():  if a tuple-like object isn't exactly a tuple, it's
not safe to return the object as-is -- make a new tuple of it instead.
This commit is contained in:
Tim Peters 2001-09-10 23:37:46 +00:00
parent caaff8d95d
commit 4c3a0a35cd
3 changed files with 7 additions and 2 deletions

View file

@ -1416,7 +1416,7 @@ def inherits():
verify(v == t)
a = madtuple((1,2,3,4,5))
verify(tuple(a) == (1,2,3,4,5))
#XXX verify(tuple(a).__class__ is tuple)
verify(tuple(a).__class__ is tuple)
a = madtuple(())
verify(tuple(a) == ())
#XXX verify(tuple(a).__class__ is tuple)