returns
returns copied to clipboard
Pylint hangs when running on a module that has type annotations from returns
I'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
Hi, @dmrz!
Hae you opened a bug in pylint?
Can you please post a link here?
I am not a pylint user, I can shamelessy plug: https://github.com/wemake-services/wemake-python-styleguide
Hi, @dmrz!
Hae you opened a bug in
pylint? Can you please post a link here?
Hi! I didn't, since I am not sure yet what is the source of the problem, just was wondering if anyone experienced the same before. Not a pylint fan, but there're projects I work on that use it. I will check that WPS, thanks!
I am pretty sure that this is on pylint, bacause our annotations work with:
- python
- flake8
mypypyright- etc
And since we use it to the max, possibly there's a regression in pylint's infering logic.
Hi! Got same issue with pylint and Result, Success, Failure. Found that by commenting everywhere import and code. After that pylint runs faster.
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.
Issue from pylint repo Very slow linting when using the dry-python/returns library #4750
Simply import returns.result hangs Pylint.
Edit: If left alone it does complete, after 1h 43m 30s