-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
Conversation
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.
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, \ |
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.
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, \ |
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.
self
should not be included here.
maxdict=4, maxset=6, maxfrozenset=6, maxdeque=6, maxstring=30, \ | ||
maxlong=40, maxother=30) |
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 align these lines with the (
.
maxdict=4, maxset=6, maxfrozenset=6, maxdeque=6, maxstring=30, \ | ||
maxlong=40, maxother=30) |
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 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'") |
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.
I think more tests need to be provided.
|
||
:class:`Repr` instances provide several attributes which can be used to provide |
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 limit lines to 80 characters in reST files (https://devguide.python.org/documenting/#use-of-whitespace).
Looks like some version of this was actually merged, so closing. |
https://bugs.python.org/issue40995