Benjamin Peterson wrote: > A while ago, Guido declared that all special method lookups on > new-style classes bypass __getattr__ and __getattribute__. This almost > completely consistent now, and I've been working on patching up a few > incorrect cases. I've know hit __enter__ and __exit__. The compiler > generates LOAD_ATTR instructions for these, so it uses the normal > lookup. The only way I can see to fix this is add a new opcode which > uses _PyObject_LookupSpecial, but I don't think we really care this > much. Opinions? 1.More consistent attribute lookup is, to me, a feature of 3.x and I appreciate you working on this. 2. I am puzzled why those two methods should be extra special, but don't know enough to say more. 3. If there are only those two or a couple of other exceptions, I'd like them listed in the 'Special method lookup' ref doc section. tjr
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4