[issue33315] Allow queue.Queue to be used in type annotations
New submission from Semyon Proshev : from queue import Queue a: Queue[int] This code throws a TypeError in runtime. But its pyi stub allows to use it in such a way (https://github.com/python/typeshed/blob/master/stdlib/3/queue.pyi) I'd suggest to update classes in queue module to allow them to be used in type annotations. -- components: Library (Lib) messages: 315488 nosy: sproshev priority: normal severity: normal status: open title: Allow queue.Queue to be used in type annotations versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue33315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33315] Allow queue.Queue to be used in type annotations
Semyon Proshev added the comment: I had been thinking about `__class_getitem__` when the issue were created. I suspected it's not difficult to implement and it follows PEP 560. So I'm +1 for `__class_item__`, quotes and postponed evaluation are also ok. -- ___ Python tracker <https://bugs.python.org/issue33315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33315] Allow queue.Queue to be used in type annotations
Semyon Proshev added the comment: I'm not sure that I'll be able to make a PR quickly, so feel free to do it -- ___ Python tracker <https://bugs.python.org/issue33315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com