[Python-Dev] Comment on PEP 562 (Module getattr and dir) (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Mon Nov 20 03:33:03 EST 2017
- Previous message (by thread): [Python-Dev] Comment on PEP 562 (Module __getattr__ and __dir__)
- Next message (by thread): [Python-Dev] Comment on PEP 562 (Module __getattr__ and __dir__)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
20.11.17 03:02, Guido van Rossum пише:
Serhiy's definition sounds recursive (defining getattr to define the behavior of getattr) but Mark's suggestion makes his intention unclear since the error message is still the same.
It is recursive only when the 'dict' attribute is not defined. I assumed that it is defined for simplicity. And if isn't defined hasattr(self, 'dict') will cause a recursion too.
In any case the real C code handles this more carefully and effectively.
- Previous message (by thread): [Python-Dev] Comment on PEP 562 (Module __getattr__ and __dir__)
- Next message (by thread): [Python-Dev] Comment on PEP 562 (Module __getattr__ and __dir__)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]