gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 and add tests#139007
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
ericvsmith
left a comment
There was a problem hiding this comment.
Use more specific unittest methods.
|
@ericvsmith please review these changes when you get a chance. |
03445c6 to
61af25c
Compare
|
I have made the requested changes; please review again . |
|
Thanks for making the requested changes! @ericvsmith: please review the changes made to this pull request. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
@vstinner thanks for the review, i've updated please let me know if we need further improvements in this. |
Documentation build overview
|
Use more specific unittest methods.
This reviews has been addressed. The tests now use assertEqual() and assertNotEqual() properly.
It failed on |
vstinner
left a comment
There was a problem hiding this comment.
LGTM. The doc is rendered correctly, I checked.
|
Oh, the "Docs / Docs" CI now fails with: Let me click on [Update branch] to solve the issue. |
|
thanks for merging, and moving this forward. |
|
GH-151372 is a backport of this pull request to the 3.15 branch. |
|
GH-151373 is a backport of this pull request to the 3.14 branch. |
|
GH-151374 is a backport of this pull request to the 3.13 branch. |
I created #151365 to track this issue. |
|
PR merged. Thanks @Aniketsy for updating the doc and writing some tests! |
#138991
This PR updates the documentation for the
eqparameter in thedataclassesmodule to reflect the new field-by-field comparison behavior introduced in Python 3.13.A .. versionchanged:: 3.13notice has been added, and the previous tuple-based comparison for Python 3.12 and earlier is described for clarity.Additionally, new tests have been added to verify the updated
__eq__implementation, including field-by-field comparison, type checking, and custom field equality logic.Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thankyou !
📚 Documentation preview 📚: https://cpython-previews--139007.org.readthedocs.build/