Fatal Python error: unknown scope for...

Marek "Baczek" Baczyński imbaczek at poczta.onet.pl
Tue Aug 5 16:54:22 EDT 2003


:map ,p :!python % <cr>
,p 
#v+
C:\COMMAND.COM /c python items.py
Fatal Python error: unknown scope for super in __init__(14) in items.py
symbols: {'multirandrange': 264}
locals: {}
globals: {'multirandrange': True}


abnormal program termination
Hit any key to close this window...
#v-
(also have mp for PyChecker, which failed miserably with the same message)

I must have done something *really* bad, I said to myself. Yet IMHO I
didn't (just paste'n'run):

class Weapon(Item):
    def __init__(self, name, category, rarity=COMMON, weight,
		 damdie = (1,6), tdamdie=(1,4), material=None, effects = (),
		 todam_f = lambda: multirandrange(-1,2,3)):
        super(Weapon, self).__init__(name, weight, damdie, tdamdie, rarity, 	
		                     material, effects, todam_f=todam_f)
        self.category = category

Apparently, removing todam_f fixes the FPE, as well as making the code
syntactically correct (moving rarity after weight.) Seems like something
got overlooked in the parser?

Almost forgot: Python 2.3/win98

Pozdrawiam, Baczek




More information about the Python-list mailing list