[Python-checkins] r42683 - peps/trunk/pep-0343.txt

Neal Norwitz nnorwitz at gmail.com
Tue Feb 28 22:49:09 CET 2006


On 2/28/06, Jim Jewett <jimjjewett at gmail.com> wrote:
> Which of these will trigger a warning in 2.5?
> Which of these will fail in 2.6?

The intent is below.  If you find the code differs, let us know.

>
> from other import name1 as name2          # I assume this works...

Should never generate a warning in any version.

>
> from other import as as name2                 # ?

Ideally this should generate a warning in 2.5, but I don't think we
implemented this.  This will stop working in 2.6.

> from other import name1 as as                 # ?

This should generate a warning in 2.5 on use, but not at the import
statement.  It will stop working 2.6.

>
> from as import name1                               # ?

This would not generate a warning in 2.6.  It will stop working in 2.6.

> import as                                                   # ?

This should generate a warning in 2.5 on use, but not at the import
statement.  It will stop working 2.6.

I realize some of these are less than desirable.  The only way to fix
these relatively easily would be to put additional checks in the AST
code.  If you are interested, patches would be accepted.  Please add
comments about how to remove them easily for 2.6 as the checks would
be dead after 2.5.

n


More information about the Python-checkins mailing list