Message408135
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) |
|
Date |
User |
Action |
Args |
2021-12-09 15:59:22 | paul.moore | set | recipients:
+ paul.moore, steven.daprano, r.david.murray, bup, Gabriele Tornetta |
2021-12-09 15:59:22 | paul.moore | set | messageid: <1639065562.72.0.786888947874.issue32683@roundup.psfhosted.org> |
2021-12-09 15:59:22 | paul.moore | link | issue32683 messages |
2021-12-09 15:59:22 | paul.moore | create | |
|