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
On the last line, typing the result as float is still important, otherwise it will be Any. Mypy's type inference is lacking here. But if we would type it as str, then mypy would say:
Looking at how we type
TaskGroup.start_soon
, we can do the same approach to have stricter type checking onTaskGroup.start
.We can do the following:
Example usage::
On the last line, typing the result as
float
is still important, otherwise it will beAny
. Mypy's type inference is lacking here. But if we would type it asstr
, then mypy would say:That is significantly better than
object
what we currently have here:https://github.com/agronholm/anyio/blob/master/src/anyio/abc/_tasks.py#L70
What do you think?
The text was updated successfully, but these errors were encountered: