__div__ not recognized automatically
tuomas.vesterinen at pp.inet.fi
Thu Nov 2 21:23:28 CET 2006
> I wrote a class
> class NumX:
> def __add__(self,other):
> def __div__(self,other):
> if not isinstance(other,NumX): other=NumX(other)
> Somewhere else I use
> where all variables are of NumX Type. When I execute the program it
> complains that it can't find an operator "/" for "instance" and "integer".
> However if I use pdb the same command works when started on the prompt. Also
> the manual execution
> works. Any suggestions what goes wrong?
More information about the Python-list