-
Notifications
You must be signed in to change notification settings - Fork 72
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
_csv is identified as Third Party instead of Stdlib #175
Comments
|
I have to import |
That's disappointing and surprising. I'm not sure that means you should be using
Except it's not documented on docs.python.org so it's not something this plugin should recognize. There's nothing to stop this module from being rewritten in a memory safe language that eliminates |
So you're saying that recognizing
It's a known issue of |
I'm saying they're not documented as the standard library. They're implementation details. Referring to them is an anti-pattern.
That's probably one of many potential solutions here. But I recognize the rest aren't on StackOverflow so they're not immediately obvious. I'd argue that https://stackoverflow.com/a/51267141 is the better solution since it seems unlikely for mypy to be able to handle other CSV readers/writers that could satisfy the API. I'd also argue this is more of a bug for typeshed/the stdlib for not providing something here. |
Currently there are a handful of
Originally there were no internal _ modules in the stdlib list but they seem to have got added over the many years since. |
@public that's something I would agree would be a bug. I know y'all aren't really working very much on this these days, but I think a compromise would be to allow people to "extend" what the canonical list of standard library modules is with a flag to Flake8. I'm happy to help out here although I can't commit to a specific timeframe of when that would get a PR or anything. |
The same thing applies to
Utilizing them directly may be an anti-pattern, but referring to them is definitely not and required by various use-cases. In my particular use-case, I must inspect the socket on the raw |
Having this code:
Produces the following error messages when running flake8 with flake8-import-order:
To my understanding,
_csv
is a stdlib module becausecsv
is and_csv
is it's "relative" written in C and flake8 has to recognize it as stdlib.The text was updated successfully, but these errors were encountered: