-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
overwriting None from Tuple[AnyStr]'s only item causes PartialType-related crash #1587
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
Labels
Comments
Here's a simpler repro which produces a similar error: from typing import AnyStr, Tuple
def split() -> Tuple[int, AnyStr]: ...
x = None
_, x = split() |
What is it supposed to mean? That x becomes an optional AnyStr? Maybe it's
crashing trying to report the problem?
…--Guido (mobile)
|
I can hit this using mkstemp with an overload that returns AnyStr. It only happens if the variable is defined as None beforehand and not annotated.
|
Simpler repro (similar to #1587 (comment) but without the confusing "output-only type var"):
|
gvanrossum
pushed a commit
that referenced
this issue
Feb 6, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
results in:
We might want to fix this before releasing.
The text was updated successfully, but these errors were encountered: