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.

classification
Title: wrong overload of slot wrapper
Type: behavior Stage:
Components: None Versions: Python 2.6
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Trundle, georg.brandl, omatt
Priority: normal Keywords:

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:53adminsetgithub: 51302
2009-10-04 09:00:07georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg93525

resolution: wont fix
2009-10-04 08:57:01Trundlesetnosy: + Trundle
messages: + msg93524
2009-10-04 07:56:00omattcreate