-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Problem Description
In the variable explorer, non-standard objects value is redundant with type. __str__ or __repr__ result would be expected to be seen, which usually carries useful information about the object.
Standard Python objects are cleared for representation visualization, but not any object (comment about this on spyder-ide/spyder#1867).
A performance issue is mentioned in the link, but I think PyCharm does show this representation for custom objects.
What steps reproduce the problem?
- Create custom object, for example:
class Vector:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __str__(self):
return "Vector (x=%f, y=%f, z=%f)" % (self.x, self.y, self.z)
vect = Vector(1,2,3)
- See variable vect in Variable Explorer. Type is
Vectorand Value isVector object of __main__ module.
What is the expected output? What do you see instead?
Value column is expected to be populated with Vector (x=1.000000, y=2.000000, z=3.000000) or similar information about the object, as print(obj) would show.
Versions
- Spyder version: 5.1.1
- Python version: 3.7.9 64 bits
- Qt version: 5.12.10
- PyQt version: 5.12.3
- Operating System name/version: Windows 10
Metadata
Metadata
Assignees
Labels
No labels