-
Notifications
You must be signed in to change notification settings - Fork 187
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
Incompatible types in assignment for document fields #602
Comments
Hi @ericbuehl thanks for opening this. Could you tell us the client version you're using? Thanks! |
Sure! I am using the latest, 2.4.1 |
Likely introduced via #536, @ericbuehl care to write some (failing) tests? Maybe a fix? |
This one is interesting. The class MyDocumentWithDouble(MyDoc):
a_double: Union[float, field.Double] = field.Double() @ericbuehl WDYT? Can we do better? |
@dblock Do we want to wait for the fix for this issue before releasing 2.4.2? |
@VachaShah no, I don't think it's fixable, and the workaround above is perfectly acceptable IMO, and it's also not a runtime problem |
What is the bug?
Using v2.4.1, types on fields are not inferred correctly when setting from instance methods
How can one reproduce the bug?
a contrived example:
running mypy would yield:
What is the expected behavior?
no type error
The text was updated successfully, but these errors were encountered: