Skip to content

flake8-pyi's Y027: use collections.abc in pyi files #479

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
Dec 23, 2022

Conversation

twoertwein
Copy link
Member

flake8-pyi encourages using collections.abc imports in pyi files.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

I'm reluctantly approving this. Given that many things like Sequence, Mapping, etc. were deprecated from typing in python 3.9, it makes sense to do this. However, I don't fully get why things like Callable and Hashable are part of collections.abc. So now if we add some typing somewhere, we have to remember which ones are in collections.abc versus typing.

@Dr-Irv Dr-Irv merged commit 9e9f840 into pandas-dev:main Dec 23, 2022
@twoertwein
Copy link
Member Author

It is not ideal since we still have to use the old imports in py files. At least for pyi files, flake8-pyi will emit a warning when we import it from the "wrong" place.

@twoertwein twoertwein deleted the flake8pyi branch February 10, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants