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

bpo-43905: Expand dataclasses.astuple() and asdict() docs #26154

Merged
merged 8 commits into from
Nov 29, 2021

Conversation

akulakov
Copy link
Contributor

@akulakov akulakov commented May 15, 2021

Expanded astuple() docs, warning about deepcopy being applied
and providing a workaround.

https://bugs.python.org/issue43905

Automerge-Triggered-By: GH:ericvsmith

Expanded ``astuple()`` docs.
@akulakov akulakov requested a review from ericvsmith as a code owner May 15, 2021 22:19
@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label May 15, 2021
@akulakov akulakov changed the title bpo-43905: Expand dataclass.astuple() docs bpo-43905: Expand dataclasses.astuple() docs May 15, 2021
@akulakov
Copy link
Contributor Author

@ericvsmith thanks for the review, updated per your comment.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 24, 2021
@ericvsmith
Copy link
Member

Closing and re-opening in order to run tests again.

@ericvsmith ericvsmith closed this Nov 28, 2021
@ericvsmith ericvsmith reopened this Nov 28, 2021
Doc/library/dataclasses.rst Outdated Show resolved Hide resolved
Doc/library/dataclasses.rst Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

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

This looks good to me. Can you add the corresponding asdict change?

@akulakov akulakov changed the title bpo-43905: Expand dataclasses.astuple() docs bpo-43905: Expand dataclasses.astuple() and asdict() docs Nov 29, 2021
@akulakov
Copy link
Contributor Author

@ericvsmith I've added the note and workaround to asdict and tweaked the wording a bit to make it clearer that the last paragraph refers to the respective function rather than the workaround example.

Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

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

Other than the news entry, this looks good to me.

@@ -0,0 +1,2 @@
Expanded ``dataclasses.astuple()`` docs, warning about deepcopy being applied
and providing a workaround.
Copy link
Member

Choose a reason for hiding this comment

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

This should also mention asdict().

@ericvsmith ericvsmith removed the stale Stale PR or inactive for long period of time. label Nov 29, 2021
@akulakov
Copy link
Contributor Author

@ericvsmith Updated the news, please take a look.

@miss-islington
Copy link
Contributor

Thanks @akulakov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2021
…6154)

Expanded ``astuple()`` docs, warning about deepcopy being applied
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c1f93f0)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Nov 29, 2021
@bedevere-bot
Copy link

GH-29851 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2021
…6154)

Expanded ``astuple()`` docs, warning about deepcopy being applied
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c1f93f0)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Nov 29, 2021
@bedevere-bot
Copy link

GH-29852 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request Nov 29, 2021
Expanded ``astuple()`` docs, warning about deepcopy being applied
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c1f93f0)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
miss-islington added a commit that referenced this pull request Nov 29, 2021
Expanded ``astuple()`` docs, warning about deepcopy being applied
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c1f93f0)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
shihai1991 added a commit to shihai1991/cpython that referenced this pull request Dec 1, 2021
* main: (21 commits)
  bpo-45876:  Have stdev() also use decimal specific square root. (pythonGH-29869)
  bpo-45876:  Correctly rounded stdev() and pstdev() for the Decimal case (pythonGH-29828)
  bpo-45711: Change exc_info related APIs to derive type and traceback from the exception instance (pythonGH-29780)
  bpo-30533:Add function inspect.getmembers_static that does not call properties or dynamic properties. (python#20911)
  bpo-45476: Disallow using asdl_seq_GET() as l-value (pythonGH-29866)
  bpo-45476: Add _Py_RVALUE() macro (pythonGH-29860)
  bpo-33381: [doc] strftime's %f option may pad zeros on the left or the right (pythonGH-29801)
  Fix EncodingWarning in Tools/freeze/test/freeze.py (pythonGH-29742)
  no-issue: remove unused import from test_graphlib.py (pythonGH-29853)
  bpo-45931: Prevent Directory.Build.props/targets from leaking from directories above the repo when building on Windows (pythonGH-29854)
  bpo-45653: fix test_embed on windows (pythonGH-29814)
  bpo-45917: Add math.exp2() method - return 2 raised to the power of x (pythonGH-29829)
  bpo-43905: Expand dataclasses.astuple() and asdict() docs (pythonGH-26154)
  bpo-44391: Remove unused argument from a varargs call. (pythonGH-29843)
  bpo-45881: configure --with-freeze-module --with-build-python (pythonGH-29835)
  bpo-45847: PY_STDLIB_MOD_SIMPLE now checks py_stdlib_not_available (pythonGH-29844)
  bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591)
  bpo-40280: Emscripten systems use .wasm suffix by default (pythonGH-29842)
  bpo-45723: Sort the grand AC_CHECK_HEADERS check (pythonGH-29846)
  bpo-45847: Make socket module conditional (pythonGH-29769)
  ...
shihai1991 added a commit to shihai1991/cpython that referenced this pull request Dec 1, 2021
* main: (21 commits)
  bpo-45876:  Have stdev() also use decimal specific square root. (pythonGH-29869)
  bpo-45876:  Correctly rounded stdev() and pstdev() for the Decimal case (pythonGH-29828)
  bpo-45711: Change exc_info related APIs to derive type and traceback from the exception instance (pythonGH-29780)
  bpo-30533:Add function inspect.getmembers_static that does not call properties or dynamic properties. (python#20911)
  bpo-45476: Disallow using asdl_seq_GET() as l-value (pythonGH-29866)
  bpo-45476: Add _Py_RVALUE() macro (pythonGH-29860)
  bpo-33381: [doc] strftime's %f option may pad zeros on the left or the right (pythonGH-29801)
  Fix EncodingWarning in Tools/freeze/test/freeze.py (pythonGH-29742)
  no-issue: remove unused import from test_graphlib.py (pythonGH-29853)
  bpo-45931: Prevent Directory.Build.props/targets from leaking from directories above the repo when building on Windows (pythonGH-29854)
  bpo-45653: fix test_embed on windows (pythonGH-29814)
  bpo-45917: Add math.exp2() method - return 2 raised to the power of x (pythonGH-29829)
  bpo-43905: Expand dataclasses.astuple() and asdict() docs (pythonGH-26154)
  bpo-44391: Remove unused argument from a varargs call. (pythonGH-29843)
  bpo-45881: configure --with-freeze-module --with-build-python (pythonGH-29835)
  bpo-45847: PY_STDLIB_MOD_SIMPLE now checks py_stdlib_not_available (pythonGH-29844)
  bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591)
  bpo-40280: Emscripten systems use .wasm suffix by default (pythonGH-29842)
  bpo-45723: Sort the grand AC_CHECK_HEADERS check (pythonGH-29846)
  bpo-45847: Make socket module conditional (pythonGH-29769)
  ...
ischurov added a commit to ischurov/cpython that referenced this pull request Feb 10, 2023
…ct that they deep copy objects in the field values, according to the changes in the docs, see python#26154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants