Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-90562: Mention slots pitfall in dataclass docs#107391

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 10 commits intopython:mainfromthejcannon:patch-1
May 21, 2024

Conversation

thejcannon
Copy link
Contributor

@thejcannonthejcannon commentedJul 28, 2023
edited by github-actionsbot
Loading

Doesn't fix the issue, but does call it out so developers know that the issue doesn't lie with them (per-se) and gives them more info on where to go.

Will need to be backported to 3.10 and 3.11.


📚 Documentation preview 📚:https://cpython-previews--107391.org.readthedocs.build/

@ericvsmith
Copy link
Member

I can't say I've seen something like this documented before. I'd like to get some more opinions on it.

thejcannon reacted with thumbs up emoji

@thejcannon
Copy link
ContributorAuthor

Yeah. If the exception was more clear, maybe it wouldn't be warranted. But it took me longer than I want to admit to put two-and-two together. And then, because I'm super nosy I was able to find the linked issue.

So I feel for the little guy who has to piece it all together. (Speaking of, I should edit to suggest the workaround, the "old-style" super call)

@AA-TurnerAA-Turner added needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsJul 28, 2023
is raised. Calling no-arg ``super()`` in dataclasses using ``slots=True`` will result in
the following Exception being raised:
``TypeError: super(type, obj): obj must be an instance or subtype of type``.
The two-arg ``super()`` is a valid workaround. See :issue:`46404` for full details.
Copy link
Member

Choose a reason for hiding this comment

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

We should try to capture everything relevant in the documentation -- what is relevant to the reader from the linked issue that isn't captured in your summary?

A

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Ithink these two points are it. What to look for and how to workaround.

AA-Turner and carljm reacted with thumbs up emoji
@carljm
Copy link
Member

I feel like early in my CPython contribution I remember someone saying "we don't document bugs, we fix them."

But I'm also sympathetic to the point of view that this is a significant limitation that people are likely to hit and with an extremely confusing symptom, and there's no clear fix for it on the horizon, and it would be kinder to our users to surface it in the docs.

So while it bugs me slightly, on the whole I think I'm in favor of this. I'll leave the final say to our documentation experts (and@ericvsmith as dataclasses expert.)

AA-Turner, thejcannon, JelleZijlstra, and LiteApplication reacted with thumbs up emoji

Copy link
Contributor

@wookie184wookie184 left a comment

Choose a reason for hiding this comment

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

This seems sensible to me. It took me a while to find out what was going on when I encountered this issue.

thejcannon reacted with rocket emoji
thejcannonand others added2 commitsAugust 7, 2023 12:02
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@hugovk
Copy link
Member

(This now has a merge conflict.)

thejcannon reacted with confused emoji

@serhiy-storchakaserhiy-storchaka added the needs backport to 3.13bugs and security fixes labelMay 9, 2024
@hugovkhugovkenabled auto-merge (squash)May 21, 2024 12:06
@hugovkhugovk merged commite3ed574 intopython:mainMay 21, 2024
@miss-islington-app
Copy link

Thanks@thejcannon for the PR, and@hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 21, 2024
)(cherry picked from commite3ed574)Co-authored-by: Josh Cannon <joshdcannon@gmail.com>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Erlend E. Aasland <erlend@python.org>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 21, 2024
)(cherry picked from commite3ed574)Co-authored-by: Josh Cannon <joshdcannon@gmail.com>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Erlend E. Aasland <erlend@python.org>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app
Copy link

GH-119350 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMay 21, 2024
@bedevere-app
Copy link

GH-119351 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelMay 21, 2024
@thejcannonthejcannon deleted the patch-1 branchMay 21, 2024 19:43
@thejcannon
Copy link
ContributorAuthor

Huzzah! 🎉

wookie184 and hugovk reacted with hooray emoji

hugovk added a commit that referenced this pull requestMay 23, 2024
…119350)Co-authored-by: Josh Cannon <joshdcannon@gmail.com>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Erlend E. Aasland <erlend@python.org>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
hugovk added a commit that referenced this pull requestMay 23, 2024
…119351)Co-authored-by: Josh Cannon <joshdcannon@gmail.com>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Erlend E. Aasland <erlend@python.org>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@e-gebes
Copy link

Could you backport this also to the 3.10 docs? I ran into the issue, and since I need to use 3.10 atm I read the 3.10 docs.

@hugovk
Copy link
Member

Sorry, 3.10 and 3.11 are only allowed to have security fixes:https://devguide.python.org/versions/

estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Erlend E. Aasland <erlend@python.org>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@hugovkhugovkhugovk left review comments

@AA-TurnerAA-TurnerAA-Turner left review comments

@ericvsmithericvsmithericvsmith approved these changes

@wookie184wookie184wookie184 approved these changes

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

11 participants
@thejcannon@ericvsmith@carljm@hugovk@e-gebes@JelleZijlstra@AA-Turner@wookie184@serhiy-storchaka@bedevere-bot@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp