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
When syncing typeshed in #11905, the type of asyncio.sleep was changed from: def sleep(delay: float, result: _T = ...) -> Future[_T]: ... to async def sleep(delay: float, result: _T = ...) -> _T: ...
This change somehow exposed an issue in type inference.
The test expects the following to reveal Future[list[Any]] in the following, after the typeshed change, the test reveals Future[Any]:
While investigating this I noticed something weird. If you add another reveal_type, mypy is once again able to infer the better Future[list[Any]] type. That is, the following shows Future[list[Any]] for the outer reveal_type.
When syncing typeshed in #11905, the type of
asyncio.sleep
was changed from:def sleep(delay: float, result: _T = ...) -> Future[_T]: ...
toasync def sleep(delay: float, result: _T = ...) -> _T: ...
This change somehow exposed an issue in type inference.
The test expects the following to reveal
Future[list[Any]]
in the following, after the typeshed change, the test revealsFuture[Any]
:While investigating this I noticed something weird. If you add another
reveal_type
, mypy is once again able to infer the betterFuture[list[Any]]
type. That is, the following showsFuture[list[Any]]
for the outerreveal_type
.The text was updated successfully, but these errors were encountered: