-
Notifications
You must be signed in to change notification settings - Fork 277
Closed
Labels
topic: otherOther topics not coveredOther topics not covered
Description
While working on support for this test in PyCharm, I noticed that it requires highlighting the function signature instead of the decorator (which is how PyCharm currently handles it).
For example:
@staticmethod
@override
def static_method1() -> int: # E: no matching signature in ancestor
return 1
@classmethod
@override
def class_method1(cls) -> int: # E: no matching signature in ancestor
return 1This would be easy to change on our end, but I believe allowing the option to highlight the decorator would be preferable for several reasons:
- Highlighting the function signature may overlap with other checks, such as PyCharm inspections or other linters.
- If the decorator is removed, the error no longer applies, so highlighting the decorator itself makes sense.
- Other conformance tests already allow highlighting decorators. For example:
- qualifiers_final_decorator.py
@final # E[func]: not allowed on non-method function.
def func1() -> int: # E[func]
return 0- overloads_definitions.py
@overload # E[func2]
def func2(x: int) -> int: # E[func2]: no implementation
...If this change makes sense, I’d be happy to submit a PR to update the test.
Metadata
Metadata
Assignees
Labels
topic: otherOther topics not coveredOther topics not covered