Guido van Rossum <gu...@python.org> 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 just 
doesn't scale. It also doesn't make sense to import everything from typing.

Arguably there are already some things in typing that don't belong there -- I'm 
thinking in particular of the 'io' and 're' classes. Those were a compromise to 
get the (in my opinion) most popular and fundamental classes quickly typed. But 
we definitely shouldn't continue down this path. Type annotations is here to 
stay (there's an increasing number of PEPs about it) and in the longer term we 
should support it directly in the appropriate stdlib modules. We're not ready 
to do that but we should start thinking about it.

Until we've gotten a firmer decision I don't think we should do one-offs, so I 
don't think Queue should be made generic right now, but we definitely shouldn't 
add it to typing. Users who are using typing should continue to consider 
themselves lucky to be early adopters and will occasionally pay a small price, 
such as putting the type in quotes or (for users on 3.7+) using "from 
__future__ import annotations".

PS. Raymond, please avoid pejoratives like "spill" in the future when talking 
about types.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33315>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to