Skip to content

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

Closed

Description

@gvanrossum

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)

Activity

  1. rwbarton commented on Jul 7, 2016

    @rwbarton
    Contributor

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

  2. ddfisher commented on Jul 21, 2016

    @ddfisher
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions