Skip to content

TYP: base_parser and readers #47359

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
Jun 15, 2022
Merged

TYP: base_parser and readers #47359

merged 1 commit into from
Jun 15, 2022

Conversation

twoertwein
Copy link
Member

No description provided.

@@ -626,6 +626,21 @@ def get_handle(
...


@overload
def get_handle(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why do we need this overloads when it's the same as the main function typing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mypy and pyright ignore annotations of the implementation when overloads are present (probably the expected behavior based on some PEP). The overloads cover "only" the cases when is_text True or False but not the case when it could be either of them.

The reason I fixed it is that pyright expects the ignore comment at a different line than mypy.

@mroeschke mroeschke added the Typing type annotations, mypy/pyright type checking label Jun 15, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jun 15, 2022
@mroeschke mroeschke merged commit a8153a8 into pandas-dev:main Jun 15, 2022
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
@twoertwein twoertwein deleted the readers branch September 21, 2022 15:29
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