Open mikesmyth opened 4 years ago
From James:
pistol% git grep "operator==" | grep "i:"
lib/Support/auto_derivative.i: bool operator==(const AutoDerivative
From Mike:
For what it is worth, there are only a few classes that have operator== defined at the python level:
pistol% git grep "operator==" | grep "i:"
lib/Support/auto_derivative.i: bool operator==(const AutoDerivative
Perhaps the best fix would be to not directly expose this to python in swig. We can define a eq python function that handles this case.
The “is None” is actually the preferred python way, according to PEP 8 (see https://docs.quantifiedcode.com/python-anti-patterns/readability/comparison_to_none.html). But a seg fault is kind of an extreme response to doing this the other way ;->
Filed as Issue #3 (https://github.com/ReFRACtor/framework/issues/3), we should fix this at some point.
This can be worked around by instead using "u is not None". But the seg fault is really still a bug.