SirGnip

Clan: Galconians Joined: Dec 27, 2006 Posts: 59 Location: Chi-town | If I have a class like this:
class MyStuff:
def __init__(self, x=0):
self.val = x
def __add__(self, rhs):
return(MyStuff(self.val + rhs.val))
Galcon throws an exception, complaining about the "__add__". So, does this mean Galcon doesn't allow classes to use the special member function names (ex: __del__, __str__, __add__, etc.?) Now, __init__ seems to be let by ok.
Your Mod API wiki page said "variables may not begin with _, contain __, or start with various reserved prefixes (f_, and more)". Does this also apply to function names?
FWIW, the exception is:
CheckStrException: (183, 'name', '__str__')
post updated on May 10, 2007 @ 8:56pm |