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

False positive for used-before-assignement with conditional import #3119

Closed
zozoens31 opened this issue Sep 24, 2019 · 0 comments
Closed

False positive for used-before-assignement with conditional import #3119

zozoens31 opened this issue Sep 24, 2019 · 0 comments

Comments

@zozoens31
Copy link

zozoens31 commented Sep 24, 2019

Steps to reproduce

Lint the following piece of code

import typing

if typing.TYPE_CHECKING:
    from typing_extensions import Literal

    AllowedValues = Literal['hello', 'world']

Current behavior

pylint:E0601 Using variable 'Literal' before assignment (used-before-assignment)

Expected behavior

The code should pass this rule (no errors)

pylint --version output

pylint 2.4.0
astroid 2.2.5
Python 3.7.2 (default, Feb 12 2019, 08:15:36)
[Clang 10.0.0 (clang-1000.11.45.5)]

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

1 participant