Skip to content

Types of properties of classes are not recognized #18474

Answered by brettcannon
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Are you using Pylance or Jedi? If it's the former then please open an issue at https://github.com/microsoft/pylance-release. If you're using Jedi then please open an issue at https://github.com/davidhalter/jedi .

Can I also suggest you look at dataclasses for what you're trying to accomplish with the above code? You can make them immutable like you seem to be after and cut down on the amount of work you're doing. I would also change your __str__ to be the __repr__ and you don't need to define __del__; Python takes care of all of that for you.

And I wouldn't use __ prefixes; that's meant to prevent name clashes with subclasses and not to hide attributes as you can still get at them with ge…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by brettcannon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.
1 participant