Cannot expand attributes of int subclass in Variables, Watch or Debug Console #1758
Unanswered
laundmo
asked this question in
Enhancements
Replies: 1 comment 1 reply
-
Thanks for the suggestion. I believe this would need some sort of setting Internally debugpy just does a Transferring to a discussion item for upvotes. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
Subclasses of int (and other "primitives") cannot be expanded and their attributes cannot be inspected.
Reproduction
Debug this python file:
As you can see, there's no toggle to expand/collapse the attributes list
![Image](https://private-user-images.githubusercontent.com/24855949/393330501-7119a785-4630-49f0-9d68-c7b77f4084e1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MjkxMDcsIm5iZiI6MTczOTUyODgwNywicGF0aCI6Ii8yNDg1NTk0OS8zOTMzMzA1MDEtNzExOWE3ODUtNDYzMC00OWYwLTlkNjgtYzdiNzdmNDA4NGUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDEwMjY0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0ZWJhNWE3ZDAwZjk0OWQyNzBiMmRiZDA4MjMwNThiMmFlZTZlZGMyZThlZDM1MzY3ZWRmZWYxY2NlZDU5NjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9GA6rPCA6HmKWOQ9Nv8g2AGC26JVeNNux35JFGID_TU)
![Image](https://private-user-images.githubusercontent.com/24855949/393329712-deb8c2f0-2336-4b08-897f-99303926cf72.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MjkxMDcsIm5iZiI6MTczOTUyODgwNywicGF0aCI6Ii8yNDg1NTk0OS8zOTMzMjk3MTItZGViOGMyZjAtMjMzNi00YjA4LTg5N2YtOTkzMDM5MjZjZjcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDEwMjY0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZjZjNhNDU5ZWZjMjAzOWRjNzdjYTU1ZGY2MmQyOWJjZmU0ZDZhMTI2MDUwZGY4MzY5NWRjMjQ3MGJmMmRlNDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ASgDEB7Uwxd-6lKyYu3Pm4YGg2nkfCjbWhTges5mIKo)
Solutions
I've orderd solutions i can think of in order of preference
isinstance(x, int)
or a equivalent to check whether a variable is a primitive type, usetype(x) is int
so only subclasses show up as normal instances.Beta Was this translation helpful? Give feedback.
All reactions