dry-python / dry-python/returns

Pylint hangs when running on a module that has type annotations from returns

未關閉
#792 8 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
4.4k
分支
155
平均合併
2 小時 27 分鐘
30 天內合併 PR
22

描述

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`:
```python
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
```

貢獻指南

開啟貢獻指南

研究方向

Reproduce the hang with the supplied test.py example and the listed Python, pylint, astroid, and returns versions. Start by tracing the astroid.decorators.raise_if_nothing_inferred generator while running pylint, then inspect the surrounding type-inference path. Done means pylint completes on the example without hanging and a regression test covers it.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。