Issue 7053: wrong overload of slot wrapper (original) (raw)

Issue7053

Created on 2009-10-04 07:56 by omatt, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py omatt,2009-10-04 07:55 example of the bug
Messages (3)
msg93522 - (view) Author: Mattelaer (omatt) Date: 2009-10-04 07:55
wrong redirection of slot wrapper: class.__iter__=list.__iter__ doesn't work. (the __iter__ still refer to the one define in class) The file in attachment shows an example of this problem
msg93524 - (view) Author: Andreas Stührk (Trundle) * Date: 2009-10-04 08:57
This is defined behaviour and no bug at all. Special methods are looked up in the type for new-style classes and not in the instance. Try changing ``self.__iter__=self.__str__`` to ``test1.__iter__ = self.__str__`` in your example (which will then raise a TypeError on the second iteration).
msg93525 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-10-04 09:00
Closing as "won't fix".
History
Date User Action Args
2022-04-11 14:56:53 admin set github: 51302
2009-10-04 09:00:07 georg.brandl set status: open -> closednosy: + georg.brandlmessages: + resolution: wont fix
2009-10-04 08:57:01 Trundle set nosy: + Trundlemessages: +
2009-10-04 07:56:00 omatt create