On Wed, 10 Jan 2001, Paul Prescod wrote: > 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. Changing dir would also make rlcompleter nicer - it's something of a pain to use with a module that has, eg, "from TERMIOS import *"-ed. This might also make "from ... import *" less of a pariah... Sounds good to me, IOW. Cheers, M.
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