Guido van Rossum wrote: > > ... > > Yes -- I came up with the same thought. > > So here's a plan: somebody please submit a patch that does only one > thing: from...import * looks for __all__ and if it exists, imports > exactly those names. No changes to dir(), or anything. Why? From my point of view, the changes to dir() are much more important. I seldom tell newbies about import * but I always tell them how they can browse objects (especially modules) with dir. If dir() is changed then IDEs and so forth would use that and inherit the right behavior. If the module exporting behavior gets more sophisticated in a future version of Python they will continue to inherit the behavior. Also, dir() could look for an __all__ on all objects including "module proxies", classes and "plain old instances". In other words we can extend the convention to other objects "for free". Paul
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