Open Mizux opened 1 month ago
Indeed testing with Python 3.13:
Python 3.13.0 (main, Oct 22 2024, 14:53:46) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dataclasses
>>> import math
>>> @dataclasses.dataclass(frozen=True)
... class X:
... x: float
... y: float
...
>>> X(math.nan,2) == X(math.nan,2)
False
With Python 3.12:
Python 3.12.6 (main, Sep 19 2024, 15:00:19) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dataclasses
>>> import math
>>> @dataclasses.dataclass(frozen=True)
... class X:
... x: float
... y: float
...
>>> X(math.nan,2) == X(math.nan,2)
True
I.e. now math.nan
is not seen equal to NaN in dataclasses
.
I guess this is the expected behavior and we should simply fix the test.
The problem referenced should now be fixed internally (the code still needs to be exported). However, there is a proto assertion immedaiately after also containing NaNs, I do not know if this will also be a python 3.13 issue.
What version of OR-Tools and what language are you using? Version:
main
OS: Linux CMake based build using python 3.13 linux runnerTrace:
ref: https://github.com/google/or-tools/actions/runs/11457583833/job/31878157585