Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Add examples forrepr=...
usage indataclasses.rst
#123118
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
base:main
Are you sure you want to change the base?
Conversation
Add additional example on how to exclude field from __repr__
ghost commentedAug 18, 2024 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
repr=...
usage indataclasses.rst
review based edits:- format to doctest- additional example with repr=False in annotation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
remove default values from example
trim whitespace
try to fix identation problem
add import to doctest
try fix not found import
try doctest tag
remove trailing spaces
replace code block with doctest
remove trailing spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Some changes still need to be done.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
example to field repr
Edit doctest output check
ellipsis
picnixz left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This should be the last round of nitpicking comments (I'll be offline for the rest of the day, so I'll leave the rest to a core dev, e.g., whether we need another example). Documentation PRs are always hard when there are examples because we need to find good ones. Thanks for keeping up with my demands!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
format first exampleCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
format second exampleCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
I'm torn. Why only examples for |
egorsmth commentedAug 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ericvsmith Hi!
I edited what I was stumble upon and to edit all doc seems will consume a lot of time. If you think that doc will become too long with similar examples for other parameters, then better to close this PR.
May be this is subjective, but yes, for me. |
Personally, I wouldn't mind having examples for each parameter, though not on the same page. The |
Uh oh!
There was an error while loading.Please reload this page.
Added additional example on how to exclude field from
__repr__
.When I opened docs to read about
@dataclass
It seems non obvious how to exclude field from generated__repr__
. So it seems an example is needed here.📚 Documentation preview 📚:https://cpython-previews--123118.org.readthedocs.build/