I am trying to use the ursina module, and just entered this code:
from ursina import *
class Game(Ursina):
def __init__(self):
pass
It generates this error:
>>> from ursina import *
>>> class Game(Ursina):
>>> ... def __init__(self):
>>> ...
Traceback (most recent call last):
File "<test>", line 3, in <module>
class Game(Ursina):
TypeError: function() argument 'code' must be code, not str
I have no code argument, so I have no clue what this is referring to.
Can someone explain and fix this error?
See Ursina issue 579.
This is a limitation of the Ursina package which doesn't let you subclass the
Ursinaclass.The
Ursinaclass is defined as:And
singletonis:This means that the decorated
Ursinais actually the function returned bysingletonrather than a class, and so it can't be subclassed.