[issue7053] wrong overload of slot wrapper

Trundle report at bugs.python.org
Sun Oct 4 10:57:02 CEST 2009


Trundle <andy-python at hammerhartes.de> added the comment:

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).

----------
nosy: +Trundle

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7053>
_______________________________________


More information about the Python-bugs-list mailing list