Hello all,
Yesterday we found the cause of a bug that has caused problems for a long time.
It appeared to be the following:
class A(object):
pass
print min(1.0, A())
which is accepted by Python even though the A() object is not numerical in
nature.
The cause of this behavior seems to be the compare operation of the object
class.
Is there a way to disable this behavior in Python (other than deriving a new
'object-like' class that doesn't do comparisons?)
Sincerely,
Albert
Yesterday we found the cause of a bug that has caused problems for a long time.
It appeared to be the following:
class A(object):
pass
print min(1.0, A())
which is accepted by Python even though the A() object is not numerical in
nature.
The cause of this behavior seems to be the compare operation of the object
class.
Is there a way to disable this behavior in Python (other than deriving a new
'object-like' class that doesn't do comparisons?)
Sincerely,
Albert
Comment