Fatal Python error: unknown scope for...

Discussion in 'Python' started by =?iso-8859-2?Q?Marek_=22Baczek=22_Baczy=F1ski?=, Aug 5, 2003.

  1. :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
     
    =?iso-8859-2?Q?Marek_=22Baczek=22_Baczy=F1ski?=, Aug 5, 2003
    #1
    1. Advertising

  2. On Wed, 06 Aug 2003 12:53:15 +1000, Mark Hammond wrote:

    >> def g(a=None, b, c=lambda: None): g
    >> """Fatal Python error: unknown scope for g in g(1) in marek.py"""

    >
    > Yep, I still get this with current CVS Python. You should open a bug.


    Done.

    Pozdrawiam, Baczek
     
    =?iso-8859-2?Q?Marek_=22Baczek=22_Baczy=F1ski?=, Aug 6, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Ellem
    Replies:
    1
    Views:
    552
    John Paquin
    Aug 27, 2003
  2. mmacrobert
    Replies:
    1
    Views:
    420
    Thomas Heller
    Aug 31, 2007
  3. Laszlo Nagy
    Replies:
    0
    Views:
    340
    Laszlo Nagy
    Jan 12, 2009
  4. Vincent Arnoux
    Replies:
    1
    Views:
    251
    Arnaud Bergeron
    Aug 11, 2006
  5. Replies:
    1
    Views:
    417
Loading...

Share This Page