Automatically add appropriate decorators when auto-completing method in child class #4343
Holt59
started this conversation in
Enhancement
Replies: 3 comments
-
Thanks for the suggestion. I want to make sure I understand. If I have say class A like so: class A:
@property
def prop1() -> str:
return 4 And I override the property in the sub class, you would expect class B(A):
def prop1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
@rchiodo Yes, currently if I auto-complete (Ctrl+Space for me) after typing def prop1() -> str:
pass I'd like to get @property # automatically added
def prop1() -> str:
pass |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When inheriting a class, Pylance can generates a "default body" when overriding parent class. If I auto-complete the following, it will generate a matching function in
B
.This auto-completion does not automatically adds appropriate decorators, in particular,
@property
to the generated function. It would be nice if this was done automatically.Beta Was this translation helpful? Give feedback.
All reactions