A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/079712.html below:

other python ideas

other python ideas other python ideasRainer Deyke root at rainerdeyke.com
Mon Apr 9 12:25:45 EDT 2001
"Jeff Petkau" <jpet at eskimo.com> wrote in message
news:CXaA6.1200$fP5.449625 at paloalto-snr1.gtei.net...
> For avoiding import statements, you could write something
> like this:
>
>     class ModuleGetter:
>         def __getattr__(self,name):
>             if name.startswith('__'):
>                 raise AttributeError
>                     return __import__(name)
>     module = ModuleGetter()

This won't work if the module you want is in another package.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor



More information about the Python-list mailing list

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