This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author average
Recipients
Date 2001-10-08.01:20:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Python-2.2a4

For user-defined types derived from built-in types, it
appears that built-in methods which return copies are
not preserving the type of self.  

>>> class Test(list): pass
>>> t=Test()
>>> map(type, [t, t[:], t+t])
[<class '__main__.Test'>, <type 'list'>, <type 'list'>]
>>> t += t
>>> type(t)
<class '__main__.Test'>

Same with types int, dictionary, etc.

Thanks,

Mark


History
Date User Action Args
2007-08-23 13:56:44adminlinkissue468887 messages
2007-08-23 13:56:44admincreate