question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change pylint to handle imports from typing module

See original GitHub issue

Current 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:

  1. # pylint: disable = import-only-modules - Change ImportOnlyModulesChecker pylint extension
  2. # pylint: disable = unused-import - Move all typing class to dummy-variables-rgx in .pylintrc
  3. # isort: skip - Add imports in sorted order*

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
DubeySandeepcommented, Jul 6, 2021

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.]

0reactions
hardikkat24commented, Aug 12, 2021

Issue 1 is solved. Issue 2 will be solved automatically with py3 style type annotations.

Closing this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found