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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTU2NjEsIm5iZiI6MTczOTYxNTM2MSwicGF0aCI6Ii8yNDg1NTk0OS8zOTMzMzA1MDEtNzExOWE3ODUtNDYzMC00OWYwLTlkNjgtYzdiNzdmNDA4NGUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEwMjkyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY3MmVlNTAxNWU1NzZjODIxODYzNTJiYzIxMzczY2IxZDc1MDkyOTZlZmExNzk2M2UyMmZhM2ZiM2EyNjY0OWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vxKLLV-dz45WzRsqa2sK_ohb6qxLs-i0VE3uIjI7AOg)
![Image](https://private-user-images.githubusercontent.com/24855949/393329712-deb8c2f0-2336-4b08-897f-99303926cf72.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTU2NjEsIm5iZiI6MTczOTYxNTM2MSwicGF0aCI6Ii8yNDg1NTk0OS8zOTMzMjk3MTItZGViOGMyZjAtMjMzNi00YjA4LTg5N2YtOTkzMDM5MjZjZjcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEwMjkyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5ZTAxMzRmYzA1NWNjZmVhMDVlYmM1M2Y5ZDY5OGMxYzhhMjk4MTQzZWU1MzZjNDNjMTkzODVlZDdhYTM3YTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fS_IG9gR7HRjJqPa_IVdr-8p2CuChe1R0Zjw4vKLmwM)
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