Skip to content

Commit

Permalink
Document no issue on S6542 when inheriting from annotated class member
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-dequenne-sonarsource committed Nov 22, 2024
1 parent 0a4a5b8 commit 87ba87b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ def return_type_check(self, text) -> Any: # Compliant
@my_annotation[42]
def some_annotated_method(self, text: Any): # Noncompliant
...

from typing import Callable
class MyClass:
my_member: Callable[[Any],Any] # No issue on nested values of "Callable"


class MyChild(MyClass):
def my_member(self, param: Any) -> Any: # OK, defined in parent
...

0 comments on commit 87ba87b

Please sign in to comment.