Change pylint to handle imports from typing module
See original GitHub issueCurrent State
Right now we are adding # pylint: disable
and isort: skip
for imports from typing module.
Solution
The changes in pylint as per discussion here.
The solution:
# pylint: disable = import-only-modules
- ChangeImportOnlyModulesChecker
pylint extension# pylint: disable = unused-import
- Move all typing class to dummy-variables-rgx in .pylintrc# isort: skip
- Add imports in sorted order*
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Python type hinting without cyclic imports - Stack Overflow
There isn't a hugely elegant way to handle import cycles in general, I'm afraid. Your choices are to either redesign your code to...
Read more >wrong-import-order / C0411 - Pylint 2.16.0-dev documentation
Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports). Problematic code:.
Read more >Python typing module - Use type checkers effectively
But this is not compulsory if you want the type of a variable to change before the function returns. # Annotates 'radius' to...
Read more >Porting Python 2 Code to Python 3 — Python 3.11.1 ...
If you are looking to port an extension module instead of pure Python code, ... Most changes required to support Python 3 lead...
Read more >Pylint Documentation - Read the Docs
can also look for certain type errors, it can recommend suggestions ... will not import this package or module, though uses Python internals ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please ignore my above comment, I found the link to Hardik’s comment in a separate PR and while writing the above comment I assumed I’m in the same PR (but later found it to be a separate issue.) [Sorry, having a bad internet connection.]
Issue 1 is solved. Issue 2 will be solved automatically with py3 style type annotations.
Closing this.