Autocompletion for __init_subclass__ (PEP 487) #2781
Replies: 4 comments 2 replies
-
I think this is a relatively rare use case, so I don't know if it makes sense to add completion suggestions specifically for this case, but we would consider it if there's sufficient user interest. Since this feature request isn't related to core type checking, I'm going to transfer it to the pylance-release project. We generally prioritize features like this one based on user feedback (upvotes). |
Beta Was this translation helpful? Give feedback.
-
@judej, you may want to move this to a discussion topic to see if there is interest from other pylance users. I don't think it needs any investigation. |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
I'm more interested in the use case of getting completions on the resulting class: class Foo:
def __init_subclass__(cls **kwargs: Any) -> None:
super().__init_subclass__(**kwargs)
cls.custom_attribute = 9
class Bar(Foo):
def __init__(self):
baz = self.custo<I would love autocompletion/type hints here> |
Beta Was this translation helpful? Give feedback.
-
I have seen in microsoft/pyright#1020 that PEP487 is supported. This also works for me, so that the types are recognized correctly and also if parameters are missing this is recognized. But what I still miss is that missing parameters are not suggested by the autocompletion. Is it possible to add this function?
With the following example, I would expect that the autocompletion suggests
bar=
:Beta Was this translation helpful? Give feedback.
All reactions