Skip to content

With statement 'as' target cannot be arbitrary lvalue #542

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 21, 2014 · 0 comments
Closed

With statement 'as' target cannot be arbitrary lvalue #542

JukkaL opened this issue Dec 21, 2014 · 0 comments
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 21, 2014

Code like this should be valid, but mypy complains about it:

y={}
with open('x.txt') as y[1]:
    print(y[1])

Mypy only allows a name to be on the rhs of as, but any lvalue should be valid.

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

No branches or pull requests

1 participant