Fatal Python error: unknown scope for...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marek Baczek Baczyñski

    Fatal Python error: unknown scope for...

    :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: {'multirandrang e': 264}
    locals: {}
    globals: {'multirandrang e': 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
  • Marek Baczek Baczyñski

    #2
    Re: Fatal Python error: unknown scope for...

    On Wed, 06 Aug 2003 12:53:15 +1000, Mark Hammond wrote:
    [color=blue][color=green]
    >> def g(a=None, b, c=lambda: None): g
    >> """Fatal Python error: unknown scope for g in g(1) in marek.py"""[/color]
    >
    > Yep, I still get this with current CVS Python. You should open a bug.[/color]

    Done.

    Pozdrawiam, Baczek

    Comment

    Working...