Skip to content
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

remove hardcoded saferepr limit #154

Closed

Conversation

ApaDoctor
Copy link

Py has hardcoded limit of saferepr.
This PR fixes that.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

overall good work at adding more elements

since this adds new behaviour, please add some tests that demonstrate the supported types

@@ -56,7 +56,7 @@ def _callhelper(self, call, x, *args):
s = s[:i] + '...' + s[len(s)-j:]
return s

def saferepr(obj, maxsize=240):
def saferepr(obj, maxsize=240,maxother=160, maxarray=6, maxdict=4):
Copy link
Member

Choose a reason for hiding this comment

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

a space is missing here

srepr.maxsize = srepr.maxlong = maxsize
srepr.maxother = maxother
srepr.maxdict = maxdict
srepr.maxlist = srepr.maxarray = srepr.maxset = srepr.maxmaxfrozenset = srepr.maxdeque = srepr.maxtuple = maxarray
Copy link
Member

Choose a reason for hiding this comment

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

i believe maxmaxfrozenset is a c&p mistake

@dimaspivak
Copy link

This would be very helpful for my team, as well. In our case, we're getting bitten by truncation in the asserts on lists. Anything I can do to help his one along as it looks to have stalled here?

@RonnyPfannschmidt
Copy link
Member

@dimaspivak since @ApaDoctor doesnt seem to responds and its a simple one, its perhaps easiest to redo the pr

@RonnyPfannschmidt
Copy link
Member

closing as no longer responsive,

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.

3 participants