Open
Description
Bug report
Bug description:
from dataclasses import dataclass
@dataclass
class a:
a: float
nan = float('nan')
Python 3.12.3
>>> nan == nan
False
>>> a(nan) == a(nan)
True
Python 3.13.0b2
>>> nan == nan
False
>>> a(nan) == a(nan)
False
The new behavior kinda makes sense, but it is a behavior change nevertheless.
Was it intentional or accidental? I cannot find anything relevant in https://docs.python.org/3.13/whatsnew/3.13.html
Possibly related to #104904 but I have not yet bisected this.
This breaks expectations in the testsuite of cattrs: python-attrs/cattrs#547
CPython versions tested on:
3.13
Operating systems tested on:
Linux