On Feb 5, 9:45 am, "Mizipzor" <[EMAIL PROTECTED]> wrote: > I have some troubles with a member variable that seems to be missing > in a class. In short, heres what I do; class A is the parent class, B > inherits from A and C inherits from B (hope I used the right words > there). Now, I create an instance of C, which calls A's __init__ which > in turn creates all the member variables. Then I call C.move() (a > function defined in A), but then, one of the variables seems to have > become 'NoneType'. > > The code can be found here (Ive taken away unnecessery > stuff):http://pastebin.com/875394 > > The exact error is (which occur on line 15 in the pasted code): > TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'
Line 15 is: self.pos += (self._direction * self.stats.speed) So obviously(???) self._direction is None What does line 8 do: self._direction = vector() ??? I'd suggest adding line 8.1: assert self._direction is not None > Any comments are welcome. :) I doubt that you really mean that, so I have refrained from commenting :-) Cheers, John -- http://mail.python.org/mailman/listinfo/python-list