Someone enlightened me

Marcus Low marcus at
Sun Jul 13 04:11:43 CEST 2008

Opps here is the mail again, incase my formatting is lost, can someone 
explain to me why this code behaves differently when "lister" and 
"self.lister" is swap remarked.

class abc :
    # remark this later and unremark "self.lister"
    lister = []
    def __init__ (self, val):
        #self.lister = []

globallist = []

def test () :

    global l
    for x in range(10) :
        o = abc(x)       
        o = ""
    for i in globallist :
        print i.lister         


More information about the Python-list mailing list