On Wed, 10 Jan 2001 18:12:20 +0100, "M.-A. Lemburg" <mal@lemburg.com> wrote: > > 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. > > +1 -- this won't be me though (at least not this week). I'm working on it -- I'll have a patch ready as soon as my slow modem will manage to finish the "cvs diff". Guido, I'll assign it to you, OK? > Cool. This could make Python instances usable as "modules" > -- with full getattr() hook support ! My Patch already does that -- if the instance supports __all__ > For IMPORT_STAR I'd suggest first looking for __all__ and > then reverting to __dict__.items() in case this fails. That's what my patch is doing. > BTW, is __dict__ needed by the import mechanism or would > the getattr/setattr slots suffice ? And if yes, must it > be a real Python dictionary ? My patch works with getattr (no setattr) as longs as there is an __all__ attribute. -- Moshe Zadka <sig@zadka.site.co.il> This is a signature anti-virus. Please stop the spread of signature viruses!
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