PEP 328: Imports: Multi-Line and Absolute/Relative

Josiah Carlson jcarlson at nospam.uci.edu
Tue Mar 23 23:30:24 CET 2004


>>from HOW.MODULE import NAMES as RENAME
>>import HOW.MODULE.NAMES as RENAME
>>
>>Where HOW is of the form:
>>-<INTEGER>[.PACKAGE1[.PACKAGE2[...]]]
>>[PACKAGE1[.PACKAGE2[...]]]

> +1. (I know I'm late :)

Glad you like it.

> Very readable, doesn't use any new magical names - and numbers have no
> other use in import statements anyway. There is something different in
> it, in a positive sense.
> 
> I'll miss the current behavior of import, though. Somehow it feels
> more intuitive to me. Oh, well, practicality beats purity - or
> personal taste...

You can still use classic import semantics, -<INTEGER> is optional.

  - Josiah



More information about the Python-list mailing list