8000 Infer variable type if initializer is None · Issue #1099 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Infer variable type if initializer is None #1099

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

Closed
JukkaL opened this issue Dec 31, 2015 · 1 comment
Closed

Infer variable type if initializer is None #1099

JukkaL opened this issue Dec 31, 2015 · 1 comment
Labels

Comments

@JukkaL
Copy link
Collaborator
JukkaL commented Dec 31, 2015

Mypy should infer the type of a variable if the first initializer is None:

def f() -> None:
    x = None
    if foo:
        x = ''
    # type of x should be str here
@JukkaL JukkaL added the feature label Dec 31, 2015
@JukkaL
Copy link
Collaborator Author
JukkaL commented Dec 31, 2015

Implemented by 5a0f7ec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant
0