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/008563.html below:

[Python-Dev] 'import as'

[Python-Dev] 'import as'Ka-Ping Yee ping@lfw.org
Fri, 18 Aug 2000 23:43:18 -0700 (PDT)
My $0.02.

+1 on:    import <modname> as <localmodname>
          import <pkgname> as <localpkgname>

+1 on:    from <modname> import <symname> as <localsymname>
          from <pkgname> import <modname> as <localmodname>

+1 on:    from <pkgname>.<modname> import <symname> as <localsymname>
          from <pkgname>.<pkgname> import <modname> as <localmodname>


-1 on *either* meaning of:

          import <pkgname>.<modname> as <localname>

...as it's not clear what the correct meaning is.

If the intent of this last form is to import a sub-module of a
package into the local namespace with an aliased name, then you
can just say

          from <pkgname> import <modname> as <localname>

and the meaning is then quite clear.



-- ?!ng




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