Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
This example should give an error with
def returns_a_or_b() -> Literal['a', 'b']: ... if returns_a_or_b() == 'c': # This can never by True ...
this depends on the implementation of type narrowing by equality checks, see #5935. Basically,