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/2004-January/042348.html below:

[Python-Dev] Draft: PEP for imports

[Python-Dev] Draft: PEP for imports [Python-Dev] Draft: PEP for importsArmin Rigo arigo at tunes.org
Fri Jan 30 08:32:53 EST 2004
Hello Guido,

On Sun, Jan 25, 2004 at 01:59:16PM -0800, Guido van Rossum wrote:
>   from /home/guido/lib/python import neatTricks

Keeping the amount of magic behind import as low as possible seems very
important, because they are not a minor feature but something that every
beginner must reasonably understand; I've already seen it as an obstacle.  
The above statement has the advantage of looking obvious; but in addition to
the package name problem there is the fact that directory names are not always
valid Python identifiers.  A last try:

  import neatTricks in "/home/guido/lib/python"      # no package
  import package.module in "/home/guido/lib/python"  # package
  import foo in "."                                  # relative import
  from neatTricks in "../cmds" import a, b, c
  s=os.path.join("some", "where"); import foo in s   # expression path

where the semantics would be to search sys.path if and only if no 'in' clause
is specified.  ('in' doesn't sound quite right...)


Armin


More information about the Python-Dev 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