-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement PEP 585 (Type Hinting Generics In Standard Collections) #83662
Comments
See PEP-585, which is still under review and may change in response to this work. |
Submitted a request for consideration by the Steering Council: python/steering-council#21 |
The SC approved the PEP! Łukasz, do you want to submit the PR to update the PEP status? We should get the implementation reviewed (e.g. by Serhiy) and land it before alpha 6 goes out, April 22 (we should aim for a week before at least). |
The base implementation has landed. We still need docs, and I'm sure that the alpha and beta release cycle will find small things that need to be improved. Perhaps the next priority is an update for Doc/whatsnew/3.9.rst. |
@gvanrossum is new types going to support generic alias protocol or this subset will be kept? Like typeshed uses os.DirEntry as a generic, but in reality it is not. (#17561) |
Ethan Smith produced a list of types that are Generic in typeshed but not in the stdlib. So these could be added. |
At this speed I can merge about 3 PRs per hour. I'll be back tomorrow. |
How are ipaddress and mmap generic? |
Check typeshed |
I tested the following example: import ipaddress, mmap x: ipaddress.IPv4Network[int] MyPy produces errors: t.py:4: error: "IPv4Network" expects no type arguments, but 1 given This is because mmap and IPv4Network are not generic types in typeshed. _BaseNetwork and _mmap are generic types, but IPv4Network and mmap are normal classes. The former are implementation detail of typeshed. _mmap does not exist in the stdlib, and _BaseNetwork in typeshed and the stdlib are different things. |
Hm, yeah it appears my methodology was too loose. Thank you for catching On Mon, Apr 13, 2020 at 2:12 AM Serhiy Storchaka <report@bugs.python.org>
|
No, I did not check other changes. These two just looked too suspicious. |
I went through the list I generated and it seems that the On Tue, Apr 14, 2020 at 4:14 PM Guido van Rossum <report@bugs.python.org>
|
Thanks!--Guido (mobile) |
In commit 0e80b56 a What's New section was added. |
This can be closed. It needs docs though; there's a separate issue for that (bpo-40814). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: