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
Is your feature request related to a problem? Please describe.
Deferred.fromFuture is annotated as returning Deferred[Any]. While this is technically correct (since Any means "any type"), it can easily be improved. Moreover, it causes projects using strict mypy checks to necessitate additional annotations.
Describe the solution you'd like
One could improve the type annotation of this method in this way:
An alternative would be leaving things as is, but as I've mentioned that requires the project that calls fromFuture to add type annotations that could be inferred from fromFuture's.
Additional context
Here is an example of code that requires such superfluous annotation: to make mypy happy, d needs to be annotated as a Deferred[MediaDescription], even though that can be inferred from the fact that the values in self._current_scans are already annotated as Future[MediaDescription].
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Deferred.fromFuture
is annotated as returningDeferred[Any]
. While this is technically correct (sinceAny
means "any type"), it can easily be improved. Moreover, it causes projects using strict mypy checks to necessitate additional annotations.Describe the solution you'd like
One could improve the type annotation of this method in this way:
Describe alternatives you've considered
An alternative would be leaving things as is, but as I've mentioned that requires the project that calls
fromFuture
to add type annotations that could be inferred fromfromFuture
's.Additional context
Here is an example of code that requires such superfluous annotation: to make mypy happy,
d
needs to be annotated as aDeferred[MediaDescription]
, even though that can be inferred from the fact that the values inself._current_scans
are already annotated asFuture[MediaDescription]
.The text was updated successfully, but these errors were encountered: