This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients terry.reedy
Date 2008-09-22.21:52:19
SpamBayes Score 9.65963e-10
Marked as misclassified No
Message-id <1222120341.98.0.209140784414.issue3936@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2008-09-22 21:52:22terry.reedysetrecipients: + terry.reedy
2008-09-22 21:52:21terry.reedysetmessageid: <1222120341.98.0.209140784414.issue3936@psf.upfronthosting.co.za>
2008-09-22 21:52:21terry.reedylinkissue3936 messages
2008-09-22 21:52:20terry.reedycreate