A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-July/016374.html below:

[Python-Dev] Advice in stat.py

[Python-Dev] Advice in stat.pyBarry A. Warsaw barry@zope.com
Mon, 30 Jul 2001 01:38:33 -0400
>>>>> "Fred" == Fred L Drake, Jr <fdrake@acm.org> writes:

    Fred>   This is about the only kind of thing I've ever found it
    Fred> useful for: re-implementing a module's interface, but when I
    Fred> only want to change a few things.

I call it "aliasing" a module (i.e. aliasing module A's symbols
exported through module B).
    
    Fred> Needing to do this never feels like a good solution, and
    Fred> probably indicates that some object needs to accept a
    Fred> parameter that offers the module's interface instead of
    Fred> finding it by name.

Um, sure, but it's can be pretty inconvenient to export 193 symbols
this way :).

>>> len(dir(Defaults))
193

I've often thought that it would be nice to have better delegation
support in Python, and no __getattr__() doesn't really hack it.  I'm
encouraged that some of the Py2.2 descr-branch stuff might actually
make this valid programming technique more useful and then even I
could see (eventually) giving up on import-*.
    
-Barry



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