Skip to content

Disallow using Undefined in arbitrary expressions #555

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 Jan 17, 2015 · 1 comment
Closed

Disallow using Undefined in arbitrary expressions #555

JukkaL opened this issue Jan 17, 2015 · 1 comment
Labels
bug mypy got something wrong topic-pep-484

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jan 17, 2015

Using Undefined should only be valid as an initializer in an assignment statement (but not as a subexpression of an initializer). These should be disallowed:

if x is Undefined: ...
y = [Undefined] # type: ...
def f(a: int = Undefined) -> int: ...

These should still be fine:

x = Undefined # type: int
y = Undefined(int)

Not sure about this one:

a, b = Undefined, Undefined # type: (int, str)

Currently Undefined can be used as an expression.

See also python/typing#20 (comment).

@JukkaL
Copy link
Collaborator Author

JukkaL commented May 17, 2015

As we are going to remove Undefined, this issue is no longer relevant.

@JukkaL JukkaL closed this as completed May 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-pep-484
Projects
None yet
Development

No branches or pull requests

1 participant