Paul Moore <p.f.mo...@gmail.com> added the comment:

I tend to agree with Steven and David here. You define __getattribute__ and so 
that's the behaviour you get when an attribute of the class is requested 
(whether by the system or by your code). The documentation (here: 
https://docs.python.org/3/reference/datamodel.html#object.__getattribute__) 
seems to support this view as well.

Do you have a real-world example of code that is broken by this behaviour, or 
is this just a theoretical problem? Is it particularly hard to make the code 
work the way you want it to with the current behaviour? For example,

    # Don't intercept __class__
    if attr == "__class__":
        return object.__getattribute__(self, attr)

----------
nosy: +paul.moore

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

Reply via email to