Message73600
Copied from c.l.p post by F. Lundh
I have no idea if this has implications for warnings in 2.6
------------------------
> >>> from sympy.mpmath import specfun
> >>>
>
> So what could be suppressing the warning?
[about 'as' becoming a keyword, when assigned to]
a bug in Python 2.5, it seems:
> more f1.py
as = 1
as = 2
as = 3
> python f1.py
f1.py:1: Warning: 'as' will become a reserved keyword in Python 2.6
f1.py:2: Warning: 'as' will become a reserved keyword in Python 2.6
f1.py:3: Warning: 'as' will become a reserved keyword in Python 2.6
> more f2.py
as = 1
import os
as = 3
> python f2.py
f2.py:1: Warning: 'as' will become a reserved keyword in Python 2.6
A quick look in parsetok.c reveals that it sets a "handling_import" flag
when it stumbles upon an "import" statement, a flag that's later used to
suppress the warning message. The bug is that the flag isn't reset
until the parser sees an ENDMARKER token (end of file), instead of when
it sees the next NEWLINE token.
(if someone wants to submit this to bugs.python.org, be my guest) |
|
Date |
User |
Action |
Args |
2008-09-22 21:52:22 | terry.reedy | set | recipients:
+ terry.reedy |
2008-09-22 21:52:21 | terry.reedy | set | messageid: <1222120341.98.0.209140784414.issue3936@psf.upfronthosting.co.za> |
2008-09-22 21:52:21 | terry.reedy | link | issue3936 messages |
2008-09-22 21:52:20 | terry.reedy | create | |
|