Fatal Python error: unknown scope for...

  • Thread starter =?iso-8859-2?Q?Marek_=22Baczek=22_Baczy=F1ski?=
  • Start date
?

=?iso-8859-2?Q?Marek_=22Baczek=22_Baczy=F1ski?=

: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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top