[issue33315] Allow queue.Queue to be used in type annotations

2020-06-13 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed status: open -> closed versions: +Python 3.9 ___ Python tracker ___ ___

[issue33315] Allow queue.Queue to be used in type annotations

2020-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Leaving this for Guido or Ivan to decide whether this feature request is fully satisfied now. -- resolution: fixed -> status: closed -> open ___ Python tracker

[issue33315] Allow queue.Queue to be used in type annotations

2020-06-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue33315] Allow queue.Queue to be used in type annotations

2020-06-13 Thread Ethan Smith
Ethan Smith added the comment: This was done in https://github.com/python/cpython/pull/19423 The implementation is as Raymond suggests: https://github.com/python/cpython/blame/5aad027db9618f22f6fa2274e05dd50f928d2ed7/Lib/queue.py#L220 On Sat, Jun 13, 2020 at 8:58 PM Raymond Hettinger wrote:

[issue33315] Allow queue.Queue to be used in type annotations

2020-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Can this can now be handled with "__class_getitem__ = classmethod(GenericAlias)"? -- type: -> behavior versions: +Python 3.10 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker

[issue33315] Allow queue.Queue to be used in type annotations

2020-06-12 Thread Sam Bull
Change by Sam Bull : -- nosy: +dreamsorcerer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33315] Allow queue.Queue to be used in type annotations

2018-05-07 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- assignee: -> levkivskyi ___ Python tracker ___ ___

[issue33315] Allow queue.Queue to be used in type annotations

2018-05-03 Thread Semyon Proshev
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 ___

[issue33315] Allow queue.Queue to be used in type annotations

2018-05-03 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Could you please product a draft PR showing how that would work? It might not be accepted right away but it would be useful to have. It is not 100% clear to whom this was addressed. Anyway, Semyon, if you don't have time, then I can

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-25 Thread Ethan Smith
Change by Ethan Smith : -- nosy: +Ethan Smith ___ Python tracker ___ ___ Python-bugs-list

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-23 Thread Guido van Rossum
Guido van Rossum added the comment: Could you please product a draft PR showing how that would work? It might not be accepted right away but it would be useful to have. On Mon, Apr 23, 2018, 05:29 Semyon Proshev wrote: > > Semyon Proshev

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-23 Thread Semyon Proshev
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. --

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-22 Thread Guido van Rossum
Guido van Rossum added the comment: [Raymond] > I don't think it makes sense to let typing considerations > start to spill into the rest of the standard library. > Either add support to typing or not. We can't possibly add every stdlib class that's generic to typing.py -- it

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-22 Thread Guido van Rossum
Guido van Rossum added the comment: Disagree strongly. More later. On Sun, Apr 22, 2018, 18:41 Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > > Another solution may be to add a simple

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Another solution may be to add a simple `__class_getitem__` to `Queue` > that will just return `cls` I don't think it makes sense to let typing considerations start to spill into the rest of the standard library. Either add

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think this issue appeared previously on typing tracker. The current recommendation is to escape problematic annotations with quotes: q: 'Queue[int]' I don't think it will be added to typing, because following this way typing will

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: None of the actual classes outside of the typing module support this either to my knowledge. You can't do: from collections import deque a: deque[int] nor can you do: a: list[int] Adding Queue to the typing

[issue33315] Allow queue.Queue to be used in type annotations

2018-04-19 Thread Semyon Proshev
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