atom-community / atom-community/ide-python

typing.TYPE_CHECKING not true during dev

オープン
#171 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
238
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

Seems like typing.TYPE_CHECKING is not true during dev.
e.g.:
```py
from typing import TYPE_CHECKING:
if TYPE_CHECKING:
from somewhere import MyClass

async def myFunction(x:str, a:int, c:"MyClass"):
c.someva # no auto-complete or suggestion here

```

if line 2 is `if TYPE_CHECKING or True`
code will be suggested and autocompleted.
based on typing.py L1444:
```py
# Constant that's True when type checking, but False here.
TYPE_CHECKING = False
```
OS Ubuntu 18.04.2 LTS
Python 3.7.1

Am i missing something, or wrong configuration?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、TYPE_CHECKING の例を使って Ubuntu 18.04.2 上の Python 3.7.1 で報告された動作を再現し、`typing.py` L1444 の参照と比較します。IDE の自動補完または language-server のエントリーポイントを追跡します。TYPE_CHECKING でガードされた import が、条件を変更せずに期待される候補を提供すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
developer-experience
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。