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

Long strings easily saturate the variable view #96

Open
dunpyl opened this issue Nov 16, 2013 · 6 comments
Open

Long strings easily saturate the variable view #96

dunpyl opened this issue Nov 16, 2013 · 6 comments

Comments

@dunpyl
Copy link

dunpyl commented Nov 16, 2013

I am using the "type" stringifier, but it apparently still returns the full string representation for str instances. As a result, any long string easily saturates the variable view, such that you can see nothing but a small chunk of the string, let alone any other variables.

@asmeurer
Copy link
Collaborator

"type" really means "safe". It returns the repr for some safe types. Set the stringifier to the function type to get the type for everything.

You can disable wrapping on a variable with the w key.

@dunpyl
Copy link
Author

dunpyl commented Nov 18, 2013

Set the stringifier to the function type to get the type for everything.

@asmeurer @inducer I tried to do that by hitting enter on the specific long string, then selecting Show Type from Variable Inspection Options. When I click OK on the dialog, it returns to the view where the string is still shown as a literal, instead of as <type 'str'>.

Is there another place I should touch to set the stringifier?

@inducer
Copy link
Owner

inducer commented Nov 18, 2013

You'd have to write your own custom stringifier (see the prefs dialog) that calls "type".

Irrespective of that, it seems to me that disabling line wrapping should resolve the issue you describe. Reopen if you disagree.

@inducer inducer closed this as completed Nov 18, 2013
@dunpyl
Copy link
Author

dunpyl commented Nov 18, 2013

I agree, it does solve the issue. Thanks.

@asmeurer
Copy link
Collaborator

Maybe it would be useful to make it easier to write one-liner stringifiers without having to make a file.

Also, it seems to me that "type" is confusing. It should maybe be renamed to "safe" or something like that.

@inducer
Copy link
Owner

inducer commented Nov 18, 2013

Agreed. Let's keep this bug to track these two.

@inducer inducer reopened this Nov 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants