Skip to content

Commit 61af25c

Browse files
committed
add note
1 parent 822bbaa commit 61af25c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/dataclasses.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Module contents
113113
(for example, ``self.a == other.a and self.b == other.b``), rather than
114114
comparing tuples of fields as in previous versions.
115115

116+
This change makes the comparison faster but it may alter results in cases
117+
where attributes compare equal by identity but not by value (such as
118+
``float('nan')``).
119+
116120
In Python 3.12 and earlier, the comparison was performed by creating
117121
tuples of the fields and comparing them (for example,
118122
``(self.a, self.b) == (other.a, other.b)``).

0 commit comments

Comments
 (0)