You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@brunoocasali it depends on how you look at it. Really Dict[str, int] has been wrong since tasks were introduced and I am thinking @alallema is first to notice and made the correction here. So really it was breaking in a previous release and a bug fix here.
The reason this was easy to miss is a dictionary is returned, but mypy has no way to know what the dictionary will be with the current implementation. Since all it knows you you said you are returning a dictionary and one is being returned it assumes you have the rest correct. The point @bidoubiwa brings up would prevent this from happening because at that point mypy would know exactly what to expect in the return values.
There is a TypedDict, but it is first available in Python 3.8. You can do it all the way back to Python 3.6 by using Pydantic classes instead of dictionaries, but that would be a big change.
@alallema if you want help or have questions with this let me know. Also, since this will be a breaking change it would be a good time to also drop Python 3.6 support, info here #378.
See this thread for context:
To enjoy the advantages of types, we should consider adding more complex types to this repo.
As per the thread
@brunoocasali asking if it is breaking.
answer from @sanders41
Implementation:
from @sanders41
The text was updated successfully, but these errors were encountered: