Skip to content

bpo-40995: reprlib.Repr attributes can be overriden in __init__() #20925

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

Closed
wants to merge 1 commit into from

Conversation

remilapeyre
Copy link
Contributor

@remilapeyre remilapeyre commented Jun 16, 2020

Copy link
Contributor

@ZackerySpytz ZackerySpytz left a comment

Choose a reason for hiding this comment

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

I'm not sure if this patch will be accepted, but I have some comments.

@@ -17,7 +17,9 @@ debugger and may be useful in other contexts as well.
This module provides a class, an instance, and a function:


.. class:: Repr()
.. class:: Repr(self, *, maxlevel=6, maxtuple=6, maxlist=6, maxarray=5, \
Copy link
Contributor

Choose a reason for hiding this comment

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

self should not be included here.

:class:`Repr` instances provide several attributes which can be used to provide
size limits for the representations of different object types, and methods
which format specific object types.
.. class:: Repr(self, *, maxlevel=6, maxtuple=6, maxlist=6, maxarray=5, \
Copy link
Contributor

Choose a reason for hiding this comment

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

self should not be included here.

Comment on lines +21 to +22
maxdict=4, maxset=6, maxfrozenset=6, maxdeque=6, maxstring=30, \
maxlong=40, maxother=30)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please align these lines with the (.

Comment on lines +77 to +78
maxdict=4, maxset=6, maxfrozenset=6, maxdeque=6, maxstring=30, \
maxlong=40, maxother=30)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please align these lines with the (.

r = Repr()
self.assertEqual(r.repr(a), "'aaaaaaaaaaaa...aaaaaaaaaaaaa'")
r = Repr(maxstring=10)
self.assertEqual(r.repr(a), "'aa...aaa'")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think more tests need to be provided.


:class:`Repr` instances provide several attributes which can be used to provide
Copy link
Contributor

Choose a reason for hiding this comment

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

Please limit lines to 80 characters in reST files (https://devguide.python.org/documenting/#use-of-whitespace).

@gvanrossum
Copy link
Member

Looks like some version of this was actually merged, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants