A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-January/032135.html below:

[Python-Dev] properties on modules?

[Python-Dev] properties on modules?Just van Rossum just@letterror.com
Mon, 13 Jan 2003 22:03:19 +0100
Guido van Rossum wrote:

> I still don't see the use case for late binding of module attributes.

The PyObjC project (the Python <-> Obective-C bridge) has/had a problem
which might have been solved with lazy module attributes: one module can
export a *lot* of ObjC classes, and building the Python wrappers takes
quite a bit of time (at runtime), so much much it was quite noticable in
the startup time, which especially hurt small apps. At some point I even
suggested to insert an object with a __getattr__ method into
sys.modules(*), but in the end some other optimizations were done to
make importing somewhat quicker.

*) I was pleasantly surprised how seamless that actually works: as long
as the object either has an __all__ or a __dict__ attribute everything
seems to work just fine. So if you *really* want lazy attributes, you
can get them...

Just



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