-
Notifications
You must be signed in to change notification settings - Fork 497
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
Inheritance breaks Optional #554
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the following code,
foo
has anOptional[A]
argument and does a check on it to see if isNone
or defined:This works, and correctly prints
"maybe_a is defined"
.However, if class a class
B
is defined and inherits fromA
, the exact same code will break at compile time:This breaks also with other types of checks:
maybe_a is not None
andmaybe_a != None
The text was updated successfully, but these errors were encountered: