[Python-Dev] dir and all (original) (raw)
Giovanni Bajo rasky at develer.com
Sat Feb 3 20:47:17 CET 2007
- Previous message: [Python-Dev] Shortcut Notation for Chaining Method Calls
- Next message: [Python-Dev] __dir__ and __all__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I could not find a PEP for dir. I was thinking today that if dir was added, I would find it useful if modules implemented it by returning all (when all is defined). Or even better, to return the same names that would be imported by a star-import (so, if all is not defined, all names which do not start with '_').
This wouldn't prevent introspection tools to use mod.dict to still access the module's global dictionary, of course. But it would allow module's authors to more clearly document the module's public API.
Giovanni Bajo
- Previous message: [Python-Dev] Shortcut Notation for Chaining Method Calls
- Next message: [Python-Dev] __dir__ and __all__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]