-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-39549: reprlib.Repr uses a “fillvalue” attribute #18343
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-39549: reprlib.Repr uses a “fillvalue” attribute #18343
Conversation
cf56ade
to
c27e567
Compare
Codecov Report
@@ Coverage Diff @@
## master #18343 +/- ##
===========================================
- Coverage 83.18% 82.11% -1.07%
===========================================
Files 1570 1954 +384
Lines 414127 583278 +169151
Branches 44406 44409 +3
===========================================
+ Hits 344505 478983 +134478
- Misses 59981 94653 +34672
- Partials 9641 9642 +1
Continue to review full report at Codecov.
|
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.
Hi,
I think setting a variable could be confused in the sense that is more quickly see
the '...' than "self.fillvalue". But is a personal point of view.
Despite of this could be a good improve to if we want to avoid 'hardcoded' things.
Why not pass the fillvalue into _init_? |
@rhettinger I would be happy to do that – I only set it up this way to match the existing manner of setting attributes on |
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.
Please update the main documentation as well: Doc/library/reprlib.rst
Include a versionchanged directive.
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 |
c27e567
to
44ba119
Compare
Thanks Zach. |
🎉🎉🎉 |
Whereas the code for
reprlib.Repr
had previously used a hardcodedstring value of
'...'
, this PR updates it to use of a “fillvalue”attribute, whose value defaults to
'...'
and can be reset in eitherindividual
reprlib.Repr
instances or in subclasses thereof.A new assert has been added to
test_reprlib.py
to verify the newattributes’ functionality.
https://bugs.python.org/issue39549