Hello!
I wrote a class
class NumX:
...
def __add__(self,ot her):
...
def __div__(self,ot her):
if not isinstance(othe r,NumX): other=NumX(othe r)
...
Somewhere else I use
a=(b+c)/2
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
a=(b+c).__div__ (2)
works. Any suggestions what goes wrong?
Anton
I wrote a class
class NumX:
...
def __add__(self,ot her):
...
def __div__(self,ot her):
if not isinstance(othe r,NumX): other=NumX(othe r)
...
Somewhere else I use
a=(b+c)/2
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
a=(b+c).__div__ (2)
works. Any suggestions what goes wrong?
Anton
Comment