Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor "if False: # TYPE_CHECKING" #1472

Closed
blueyed opened this issue Jan 10, 2020 · 3 comments
Closed

Honor "if False: # TYPE_CHECKING" #1472

blueyed opened this issue Jan 10, 2020 · 3 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Jan 10, 2020

pytest does not use if TYPE_CHECKING, but if False: # TYPE_CHECKING, recommended by flake8:

TYP001 guard import by if False: # TYPE_CHECKING: TYPE_CHECKING (not in 3.5.0, 3.5.1)

I think it would be good if Jedi would handle those comments (maybe requiring the exact comment).

The alternative would be trying to import it from typing_extensions I guess, but that would require code changes to pytest. The other alternative is dropping support for Python < 3.5.2, which will eventually be done, of course.

(via pytest-dev/pytest#6434)

Related Jedi issue: #1127

@davidhalter
Copy link
Owner

Why does pytest use this and not just the variable?

@blueyed
Copy link
Contributor Author

blueyed commented Jan 10, 2020

To support Python 3.5.0/3.5.1 I assume.

@davidhalter
Copy link
Owner

Makes sense.

It's just that I already started removing support for some things for 3.5. So 3.6 is really the target for Jedi to support. 3.5 is going to be end of life in 10 months :)

So I guess I'm closing, because this will solve itself in a few months.

blueyed added a commit to blueyed/pytest that referenced this issue Jan 10, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 10, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 11, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 14, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 14, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 14, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 14, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 15, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 15, 2020
This allows for e.g. Jedi to infer types.

It was only used to support Python 3.5.0/3.5.1, where this is available
in `typing_extensions`.

Ref: davidhalter/jedi#1472
blueyed added a commit to blueyed/pytest that referenced this issue Jan 15, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Put at the top to work around circular import.
blueyed added a commit to blueyed/pytest that referenced this issue Jan 15, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Put at the top to work around circular import.
blueyed added a commit to blueyed/pytest that referenced this issue Jan 16, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Put at the top to work around circular import.
blueyed added a commit to blueyed/pytest that referenced this issue Jan 16, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Put at the top to work around circular import.
blueyed added a commit to blueyed/pytest that referenced this issue Jan 16, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Uses `TYPE_CHECKING = False` in `_pytest.outcomes` to avoid having to
work around circular import.
blueyed added a commit to blueyed/pytest that referenced this issue Jan 16, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Uses `TYPE_CHECKING = False` in `_pytest.outcomes` to avoid having to
work around circular import.
blueyed added a commit to blueyed/pytest that referenced this issue Jan 16, 2020
This allows for e.g. Jedi to infer types (it checks the name).

It was only used to support Python 3.5.0/3.5.1, where this is is not
available in the `typing` module.

Ref: davidhalter/jedi#1472

Uses `TYPE_CHECKING = False` in `_pytest.outcomes` to avoid having to
work around circular import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants