This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author asvetlov
Recipients asvetlov, yselivanov
Date 2019-12-05.12:53:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1575550403.72.0.0854877987028.issue38978@roundup.psfhosted.org>
In-reply-to
Content
Typeshed declares asyncio.Future, asyncio.Task and asyncio.Queue as generic types, which is 100% correct.

The problem is that these classes don't support generic instantiation in runtime, e.g. Future[str] raises TypeError.

The feature should be implemented by adding __class_getitem__ methods which return self.

The patch is trivial but requires a few lines of C code for C Accelerated CTask and CFuture as well as updating Python code.

A volunteer is welcome!
History
Date User Action Args
2019-12-05 12:53:23asvetlovsetrecipients: + asvetlov, yselivanov
2019-12-05 12:53:23asvetlovsetmessageid: <1575550403.72.0.0854877987028.issue38978@roundup.psfhosted.org>
2019-12-05 12:53:23asvetlovlinkissue38978 messages
2019-12-05 12:53:23asvetlovcreate