Skip to content

Conversation

@MarcoGorelli
Copy link
Member

Noticed this while working on #40973

Those without any types won't be checked by mypy

e.g.:

$ cat t.py
from typing import final

class Foo:
    @final
    def foo(x) -> None:
        pass

class Bar(Foo):
    def foo(x):
        pass
$ mypy t.py
Success: no issues found in 1 source file

Adding in -> None:

$ cat t.py
from typing import final

class Foo:
    @final
    def foo(x) -> None:
        pass

class Bar(Foo):
    def foo(x) -> None:
        pass
$ mypy t.py
t.py:9: error: Cannot override final attribute "foo" (previously declared in base class "Foo")  [misc]
Found 1 error in 1 file (checked 1 source file)

@MarcoGorelli MarcoGorelli added the Typing type annotations, mypy/pyright type checking label Apr 16, 2021
@jbrockmendel jbrockmendel merged commit c45be0d into pandas-dev:master Apr 16, 2021
@jbrockmendel
Copy link
Member

Thanks @MarcoGorelli

@MarcoGorelli MarcoGorelli deleted the series-missing-types branch April 16, 2021 17:31
yeshsurya pushed a commit to yeshsurya/pandas that referenced this pull request Apr 21, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Typing type annotations, mypy/pyright type checking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants