Skip to content

==/!= doesn't work on optional type #1824

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
gvanrossum opened this issue Jul 7, 2016 · 2 comments
Closed

==/!= doesn't work on optional type #1824

gvanrossum opened this issue Jul 7, 2016 · 2 comments

Comments

@gvanrossum
Copy link
Member

Behold:

def f(a: Optional[str], b: Optional[str]) -> bool:
  return a == b

We get this beautiful error with --strict-optional:

error: Unsupported left operand type for == (some union)
@rwbarton
Copy link
Contributor

rwbarton commented Jul 7, 2016

Maybe not obvious, but #1766 was a reduction of this issue.

@ddfisher
Copy link
Collaborator

No longer gives an error. I think this was fixed along with #1766 by #1836.

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

No branches or pull requests

3 participants