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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjIwNzQsIm5iZiI6MTczOTM2MTc3NCwicGF0aCI6Ii8yNDg1NTk0OS8zOTMzMzA1MDEtNzExOWE3ODUtNDYzMC00OWYwLTlkNjgtYzdiNzdmNDA4NGUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEyMDI1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhNGNkZjRjMDU0ODYzOTY2ZWQzMTJiMzVkNDNmMTAzODMwNDZmNTkzODIwMzlmMzcwZjJiNTkxYjRmMzUwNzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bzPu3LG6dmqmkWCaqb9T9_rYcXmhG--StAZ1HETk3wU)
![Image](https://private-user-images.githubusercontent.com/24855949/393329712-deb8c2f0-2336-4b08-897f-99303926cf72.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjIwNzQsIm5iZiI6MTczOTM2MTc3NCwicGF0aCI6Ii8yNDg1NTk0OS8zOTMzMjk3MTItZGViOGMyZjAtMjMzNi00YjA4LTg5N2YtOTkzMDM5MjZjZjcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEyMDI1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhNjZiZmJmNWJlYmI0NjZjNDk5YTFjYmNiZDNkOTBkYjc3MTFkODgyOTQ1ZTE3OGI3MTA0YmNiYjFkZjUzODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.THXLWFGZaJc7wYv4Suyr76rJytYiSxTgUBUIGhJR8xg)
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