bpo-39549: reprlib.Repr uses a “fillvalue” attribute #18343
Conversation
cf56ade
to
c27e567
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.
|
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 |
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
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
The text was updated successfully, but these errors were encountered: