FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-88071: Update docstrings of dataclass' astuple and asdict by ischurov · Pull Request #101806 · python/cpython · GitHub

/ cpython Public

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

Merged
carljm merged 1 commit into
python:mainfrom
ischurov:patch-astuple-asdict-deepcopy
Mar 11, 2023
Merged

gh-88071: Update docstrings of dataclass' astuple and asdict#101806
carljm merged 1 commit into
python:mainfrom
ischurov:patch-astuple-asdict-deepcopy

Conversation

ischurov commented Feb 10, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

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 that 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

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

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

ghost commented Feb 10, 2023
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

arhadthedev added the stdlib Standard Library Python modules in the Lib/ directory label Feb 10, 2023
hauntsaninja changed the title gh-88071: Update docstrings gh-88071: Update docstrings of dataclass' astuple and asdict Feb 19, 2023

carljm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL