-
Notifications
You must be signed in to change notification settings - Fork 183
Closed
Labels
needs reproIssue has not been reproduced yetIssue has not been reproduced yet
Description
Problem
Subclasses of int (and other "primitives") cannot be expanded and their attributes cannot be inspected.
Reproduction
Debug this python file:
class SomeIntSubclass(int):
def some_method(self):
pass
class SomeClass:
def some_method(self):
pass
normal_instance = SomeClass()
int_instance = SomeIntSubclass(1)
breakpoint()As you can see, there's no toggle to expand/collapse the attributes list


Solutions
I've orderd solutions i can think of in order of preference
- Instead of using
isinstance(x, int)or a equivalent to check whether a variable is a primitive type, usetype(x) is intso only subclasses show up as normal instances. - A setting to treat all values, be they "primitives" or not, as objects which can be inspected
- A special cased command, function, or similar in the Debug Console to inspect a "primitive" as if it was a normal instance
Metadata
Metadata
Assignees
Labels
needs reproIssue has not been reproduced yetIssue has not been reproduced yet