atom-community / atom-community/ide-python
typing.TYPE_CHECKING not true during dev
- Dominant language
- JavaScript
- Stars
- 238
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
Research direction
Start by reproducing the reported behavior with Python 3.7.1 on Ubuntu 18.04.2 using the TYPE_CHECKING example and compare it with the `typing.py` L1444 reference. Trace the IDE's autocomplete or language-server entry point; done means imports guarded by TYPE_CHECKING provide the expected suggestion without changing the condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100