New submission from Terry J. Reedy <[EMAIL PROTECTED]>: 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) ---------- components: Interpreter Core messages: 73600 nosy: tjreedy severity: normal status: open title: Faulty suppression of 'as' keyword warning versions: Python 2.5 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3936> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com