pygame - importing GL - very bad...

someone newsboost at
Wed Jan 2 00:49:36 CET 2013

On 01/01/2013 12:49 PM, Steven D'Aprano wrote:
 > On Tue, 01 Jan 2013 12:00:32 +0100, someone wrote:
 >> See this code (understand why I commented out first line):
 >> # from OpenGL.GL import *
 > [...]
 >> The reason why I commented out the first line is that I use "pylint" and
 >> it reports: "[W] Redefining built-in 'format'" for this line.
 >> From: tell: W0621: Redefining
 >> name %r from outer scope (line %s) Used when a variable's name hide a
 >> name defined in the outer scope.
 >> I don't like to redefine already defined names so therefore I had to
 >> outcomment first line and then keep on adding stuff until I could run my
 >> program... But this SUCKS! I can see that pygame hasn't been updated for
 >> a long while - not many users use it? I'm not very happy about this...
 > from pygame import *
 > del format

Are you sure about this? Because I'm not (OTOH I'm maybe not as 
experienced in python as some of you)... Ipython log:

In [6]: test=format(43)

In [7]: type(test)
Out[7]: str

In [8]: from pygame import *

In [9]: test=format(43)

In [10]: type(test)
Out[10]: str

In [11]: del format
NameError                                 Traceback (most recent call last)
<ipython-input-11-028e6ffb84a8> in <module>()
----> 1 del format

NameError: name 'format' is not defined

What does this mean? Why does it say 'format" cannot be deleted after I 
did the wildcard import ?

 > pylint may still complain, but you can ignore it. By deleting the name
 > "format", that will unshadow the builtin format.

Are you sure?

More information about the Python-list mailing list