[Python-bugs-list] [ python-Bugs-604036 ] spurious SyntaxWarning
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 03 Sep 2002 15:38:18 -0700
Bugs item #604036, was opened at 2002-09-03 16:05
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=604036&group_id=5470
Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: spurious SyntaxWarning
Initial Comment:
The compiler now warns about assignment to None, however it trips
up on this innocuous optimization:
from __builtin__ import None
----------------------------------------------------------------------
>Comment By: Jeremy Hylton (jhylton)
Date: 2002-09-03 22:38
Message:
Logged In: YES
user_id=31392
Right, in this particular case it is safe. The programmer
can also use the warnings module to stop the warning about
the optimization. The same would happen is someone used
"None=None" in an argument list.
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2002-09-03 22:35
Message:
Logged In: YES
user_id=44345
Granted, perhaps it's not. In this case it is. The programmer was
copying None from builtins to the local scope to speed up access to that
object. If they had done something like
None = 87
I would have expected a warning.
----------------------------------------------------------------------
Comment By: Jeremy Hylton (jhylton)
Date: 2002-09-03 22:21
Message:
Logged In: YES
user_id=31392
Maybe it isn't innocuous.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=604036&group_id=5470