basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Type usage other than constructor should not show `Any` errors from constructor

Open KotlinIsland opened this issue 3 years ago • 0 comments

class B:
    def __init__(self, foo: Untyped): ...
    @staticmethod
    def bar(): ...
B.bar()  # error: Expression type contains "Any" (has type "type[B]")  [no-any-expr]

Despite the fact that Bs constructor contains Any, it's not being used here.

KotlinIsland avatar Jun 22 '22 02:06 KotlinIsland