Skip to content

TYP add some missing types to series #40975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2021

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