Steven D'Aprano added the comment:

This is not a small change, and will need careful thought.

The problem is that in Python 3 (and in Python 2 for new-style classes), dunder 
methods are only called by the interpreter if they are defined on the class 
itself, not on the instance. That's an optimization, and it does mean that (for 
example) automatic delegation doesn't work with dunder methods.

But if we change this, we should change it for *all* dunder methods, not just 
__iter__. It would be a problem if we start "fixing" dunders piecemeal, one at 
a time. Either they should all work (like with classic classes) or none of them 
should.

So this is potentially a big change.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30352>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to