Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-88071: Update docstrings of dataclass' astuple and asdict #101806

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

ischurov
Copy link
Contributor

@ischurov ischurov commented Feb 10, 2023

Updated docstrings of astuple and asdict to reflect that they deep copy objects in the field values, according to the changes in the docs (see #26154 and #88071).

I believe the this behaviour of astuple and asdict is rather counter-intuitive and it is important to inform the developer about it in the docstring. (I personally spent half an hour trying to fix a bug that appeared because I wasn't aware of it.)

…ct that they deep copy objects in the field values, according to the changes in the docs, see python#26154
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Feb 10, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@arhadthedev arhadthedev added the stdlib Python modules in the Lib dir label Feb 10, 2023
@hauntsaninja hauntsaninja changed the title gh-88071: Update docstrings gh-88071: Update docstrings of dataclass' astuple and asdict Feb 19, 2023
Copy link
Member

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to mention this in the docstring as well as the docs; change LGTM.

@carljm carljm merged commit 767d3a8 into python:main Mar 11, 2023
iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Mar 12, 2023
…ython#101806)

Update dataclasses.astuple and dataclasses.asdict docstrings to reflect that they deep copy objects in the field values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news stdlib Python modules in the Lib dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants