Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move versionchanged block after 'ignored' sentence
  • Loading branch information
Aniketsy committed Jun 11, 2026
commit 1d02dd7713679436a5812261504a2e887b2902fd
16 changes: 8 additions & 8 deletions Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ Module contents
This method compares the class by comparing each field in order. Both
instances in the comparison must be of the identical type.

If the class already defines :meth:`!__eq__`, this parameter is ignored.

.. versionchanged:: 3.13
The generated ``__eq__`` method now compares each field individually
(for example, ``self.a == other.a and self.b == other.b``), rather than
comparing tuples of fields as in previous versions.

This change makes the comparison faster but it may alter results in cases
where attributes compare equal by identity but not by value (such as
``float('nan')``).
This change makes the comparison faster but it may alter results in cases
where attributes compare equal by identity but not by value (such as
``float('nan')``).

In Python 3.12 and earlier, the comparison was performed by creating
tuples of the fields and comparing them (for example,
``(self.a, self.b) == (other.a, other.b)``).

If the class already defines :meth:`!__eq__`, this parameter is ignored.
In Python 3.12 and earlier, the comparison was performed by creating
tuples of the fields and comparing them (for example,
``(self.a, self.b) == (other.a, other.b)``).

- *order*: If true (the default is ``False``), :meth:`~object.__lt__`,
:meth:`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods will be
Expand Down
Loading