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/2000-August/008490.html below:

[Python-Dev] 'import as'

[Python-Dev] 'import as'Barry A. Warsaw bwarsaw@beopen.com
Fri, 18 Aug 2000 09:27:05 -0400 (EDT)
>>>>> "Gordo" == Gordon McMillan <gmcm@hypernet.com> writes:

    Gordo> A whole lot rides on what you mean by "resulting" above. If
    Gordo> by "resulting" you mean "goom", then "import goom.bah as
    Gordo> snarf" would result in my namespace having "snarf" as an
    Gordo> alias for "goom", and I would use "bah" as "snarf.bah". In
    Gordo> which case Greg Ewing is right, and it's "import <dotted
    Gordo> name> as ..."  that should be outlawed, (since that's not
    Gordo> what anyone would expect).

Right.

    Gordo> OTOH, if by "resulting" you meant "bah", things are much 
    Gordo> worse, because it means you must patched code you didn't 
    Gordo> understand ;-b.

But I think it /is/ useful behavior for "import <dotted name> as" to
bind the rightmost attribute to the local name.  I agree though that
if that can't be done in a sane way, it has to raise an exception.
But that will frustrate users.

-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