-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Variable Explorer display of pathlib.Path not very helpful #12683
Comments
Hi @gb119, thanks for your suggestion. Indeed the value displayed is not very helpful at first glance, clicking on it however does provide more information. @spyder-ide/core-developers do you think we should have: 1.) some curated list of default objects and methods to use for the value on the Collections Editor of the Variable Explorer object_value_method = {
'pathlib.PosixPath': '__repr__',
} This will of course keep growing in time but could provide better results for the value object. 2.) Or would it make sense to always use the Thanks |
Sounds good, with (further down the line) the possibility for users to add to it. Actually, I think that for many types we can just use
I seem to remember that there were problems with this because the string representation can be extremely long. |
You could make it an option on the variable explorer to use an object's repr() for all unknown object types - leave it off for the current behaviour, on for to have a read-only truncated display of the objects repr. |
Fair enough @jitseniesen , closing in favor of those issues. Please follow the progress there @gb119 Cheers! |
Description
What steps will reproduce the problem?
Create a variable that is a pathlib.Path e.g.
Observe that the entry for pth in the Variable Explorer doesn't in fact readily give you much infromation about the path!
repr(pth) would be more useful.
Versions
Dependencies
The text was updated successfully, but these errors were encountered: