Pylint hangs when running on a module that has type annotations from returns
See original GitHub issueI’ve noticed pylint is hanging (vscode’s python plugin started to consume 100% CPU) when trying to lint a module that has type annotations from returns library.
Consider the following test.py
:
from returns.maybe import Maybe, Some
x: Maybe[int] = Some(1)
Running pylint test.py
will hang forever.
Not sure if the problem is with returns or pylint itself (or maybe something with my local setup, tried both with my regular pylint config and without it though). Didn’t spend much time debugging it, but sometimes I noticed it hangs in astroid.decorators.raise_if_nothing_inferred
generator. Does anyone experience the same?
python: 3.7.9, 3.9.0
pylint: 2.6.0
astroid: 2.4.2
returns: 0.15.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (4 by maintainers)
Top Results From Across the Web
False positive ``syntax-error`` for badly placed type annotations
Expected behaviour is a code being able to run, with no errors shown. pylint --version output. 2.5.2. What I tried. I tried reload...
Read more >Annotation issues at runtime - mypy 0.991 documentation
Annotation issues at runtime#. Idiomatic use of type annotations can sometimes run up against what a given version of Python considers legal code....
Read more >What's New in Pylint 2.15 - Pylint 2.16.0-dev documentation
The returned module objects and errors that were cached by the ... Fix crash when a type-annotated __slots__ with no value is declared....
Read more >typing — Support for type hints — Python 3.11.1 documentation
Source code: Lib/typing.py This module provides runtime support for type hints. ... PEPs have modified and enhanced Python's framework for type annotations.
Read more >Understanding type annotation in Python - LogRocket Blog
To annotate return value type, add -> immediately after closing the ... in Python ≤3.8, you have to import it from the typing...
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
Issue from pylint repo Very slow linting when using the dry-python/returns library #4750
Please, report this on pylints repo! And post an issue number here. 👍
I can help pylint’s team, but there’s nothing we can do from our side.