[Python-Dev] Re: [Python-checkins] python/dist/src/Python
compile.c, 2.306, 2.307
Raymond Hettinger
python at rcn.com
Fri Jul 16 03:43:32 CEST 2004
> Python 2.4a1+ (#13, Jul 16 2004, 09:11:38)
> [GCC 3.3.2 (Debian)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> None = 0
> <stdin>:1: SyntaxWarning: assignment to None
> >>> print None # But assignment has no effect... perhaps due to this
> optim.?
> None
> >>> def f():
> ... None = 0
> ...
> <stdin>:2: SyntaxWarning: assignment to None
> >>> f()
>
> My CVS tree is up-to-date, and I did a "make clean". Is everyone else
> getting the SyntaxError for this?
Hmm, it looks like I got burnt by IDLE which is converting the
SyntaxWarning into a SyntaxError:
Python 2.4a1 (#54, Jul 8 2004, 11:30:13) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> None = 0
<stdin>:1: SyntaxWarning: assignment to None
Python 2.4a1 (#54, Jul 8 2004, 11:30:13) [MSC v.1310 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license()" for more information.
IDLE 1.1a0
>>> None = 0
SyntaxError: assignment to None (<pyshell#0>, line 1)
That raises the question. Since there was a SyntaxWarning in Py2.3,
should it have been escalated to an error for Py2.4?
Raymond
More information about the Python-Dev
mailing list