[Python-Dev] Relative import

Michael Hudson mwh at python.net
Tue Dec 23 12:24:27 EST 2003


Charles Hixson <charleshixsn at earthlink.net> writes:

> Not necessarily.  import could be a special function that doesn't need
> parentheses around it's arguments or comma separators.  That could be
> syntax sugar for:
> import (names, namedAs, fromModule, searchmethod) or
> import (names =[theNames],  namedAd=[localNames],
> fromModule=fromModule, searchMethod=upFromCurrent)
>
> OTOH, to me it looks more like Smalltalk than like Python.  An
> explicit import function without special sugar looks more Pythonic.
> (But that would break backward compatibility.)
> Perhaps the current method could be deprecated, and an import function
> be the replacement?

I really don't think you could make that work (unless you want to
write

math = import("math")

everywhere, which you can almost do today...)

Cheers,
mwh

-- 
  Ya, ya, ya, except ... if I were built out of KSR chips, I'd
  be running at 25 or 50 MHz, and would be wrong about ALMOST
  EVERYTHING almost ALL THE TIME just due to being a computer!
                                              -- Tim Peters, 30 Apr 97



More information about the Python-Dev mailing list