[Python-bugs-list] [ python-Bugs-418898 ] __debug__ assignment via setattr

noreply@sourceforge.net noreply@sourceforge.net
Thu, 26 Apr 2001 10:53:21 -0700


Bugs item #418898, was updated on 2001-04-25 11:01
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=418898&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
Resolution: None
>Priority: 7
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Jeremy Hylton (jhylton)
Summary: __debug__ assignment via setattr

Initial Comment:
assignment to __debug__ via setattr does not raise a
warning:

Python 2.1 (#1, Apr 17 2001, 17:26:34)
[GCC 2.96 20000731 (Red Hat Linux 7.0)] on linux2
Type "copyright", "credits" or "license" for more
information
>>> import __builtin__
>>> __debug__
1
>>> setattr(__builtin__, '__debug__', 0)
>>> __debug__
0
>>> __debug__ = 1
<stdin>:0: SyntaxWarning: can not assign to __debug__
>>> 

As long as this behavior is going in, it ought to go in
wholesale.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=418898&group_id=5470