Skip to content

Implement PEP 585 (Type Hinting Generics In Standard Collections) #83662

Description

@gvanrossum
BPO 39481
Nosy @gvanrossum, @ambv, @serhiy-storchaka, @ethanhs, @miss-islington, @isidentical, @gousaiyang
PRs
  • bpo-39481: Implementation for PEP 585 #18239
  • bpo-39481: Generic alias to os.DirEntry #19415
  • bpo-39481: Generic alias for itertools.chain #19417
  • bpo-39481: Add GenericAlias support to ipaddress.py #19418
  • bpo-39481: Make enumerate, AsyncGeneratorType, mmap generic #19421
  • bpo-39481: PEP 585 for difflib, filecmp, fileinput #19422
  • bpo-39481: PEP 585 for a variety of modules #19423
  • bpo-39481: Make dataclasses.Field, contextvars.Token, ... #19425
  • bpo-39481: Make functools.cached_property, partial, ... #19427
  • bpo-39481: Generic alias support to ctypes.Array, LibraryLoader... #19434
  • bpo-39481: Generic alias support to mp.ValueProxy, mp.ApplyResult, mp… #19435
  • bpo-39481: fix test_genericalias on Android #19469
  • bpo-39481: Make weakref and WeakSet generic #19497
  • bpo-39481: remove generic classes from ipaddress/mmap #20045
  • bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py #22619
  • [3.9] bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619) #22624
  • 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:

    assignee = None
    closed_at = <Date 2020-07-25.21:57:06.912>
    created_at = <Date 2020-01-28.17:16:57.906>
    labels = ['interpreter-core', 'type-bug', '3.9']
    title = 'Implement PEP 585 (Type Hinting Generics In Standard Collections)'
    updated_at = <Date 2020-10-12.23:52:11.592>
    user = 'https://github.com/gvanrossum'

    bugs.python.org fields:

    activity = <Date 2020-10-12.23:52:11.592>
    actor = 'gvanrossum'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-07-25.21:57:06.912>
    closer = 'gvanrossum'
    components = ['Interpreter Core']
    creation = <Date 2020-01-28.17:16:57.906>
    creator = 'gvanrossum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39481
    keywords = ['patch']
    message_count = 29.0
    messages = ['360885', '364311', '365357', '365914', '365916', '365936', '365943', '365949', '366102', '366104', '366105', '366106', '366108', '366109', '366131', '366288', '366309', '366311', '366333', '366366', '366367', '366464', '366468', '366476', '367244', '368697', '374286', '378343', '378535']
    nosy_count = 7.0
    nosy_names = ['gvanrossum', 'lukasz.langa', 'serhiy.storchaka', 'ethan smith', 'miss-islington', 'BTaskaya', 'gousaiyang']
    pr_nums = ['18239', '19415', '19417', '19418', '19421', '19422', '19423', '19425', '19427', '19434', '19435', '19469', '19497', '20045', '22619', '22624']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39481'
    versions = ['Python 3.9']

    Activity

    1. gvanrossum commented on Jan 28, 2020

      @gvanrossum
      MemberAuthor

      See PEP-585, which is still under review and may change in response to this work.

      https://www.python.org/dev/peps/pep-0585/

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-bugAn unexpected behavior, bug, or error
      on Jan 28, 2020
    3. ambv commented on Mar 16, 2020

      @ambv
      Contributor

      Submitted a request for consideration by the Steering Council: python/steering-council#21

    4. gvanrossum commented on Mar 30, 2020

      @gvanrossum
      MemberAuthor

      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).

    5. gvanrossum commented on Apr 7, 2020

      @gvanrossum
      MemberAuthor

      New changeset 48b069a by Guido van Rossum in branch 'master':
      bpo-39481: Implementation for PEP-585 (bpo-18239)
      48b069a

    6. gvanrossum commented on Apr 7, 2020

      @gvanrossum
      MemberAuthor

      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.

    7. isidentical commented on Apr 7, 2020

      @isidentical
      SponsorMember

      @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)

    8. gvanrossum commented on Apr 7, 2020

      @gvanrossum
      MemberAuthor

      Ethan Smith produced a list of types that are Generic in typeshed but not in the stdlib. So these could be added.

      gvanrossum#1 (comment)

    9. gvanrossum commented on Apr 7, 2020

      @gvanrossum
      MemberAuthor

      New changeset f9dd51e by Batuhan Taşkaya in branch 'master':
      bpo-39481: Make os.DirEntry generic (GH-19415)
      f9dd51e

    10. gvanrossum commented on Apr 10, 2020

      @gvanrossum
      MemberAuthor

      New changeset 2fa67df by Batuhan Taşkaya in branch 'master':
      bpo-39481: PEP-585 for ipaddress.py (GH-19418)
      2fa67df

    11. 8 remaining items

    12. serhiy-storchaka commented on Apr 13, 2020

      @serhiy-storchaka
      Member

      No, I did not check other changes. These two just looked too suspicious.

    13. gvanrossum commented on Apr 13, 2020

      @gvanrossum
      MemberAuthor

      New changeset 25a6833 by Chih-Hsuan Yen in branch 'master':
      bpo-39481: fix test_genericalias on Android (GH-19469)
      25a6833

    14. gvanrossum commented on Apr 14, 2020

      @gvanrossum
      MemberAuthor

      New changeset cecf049 by Ethan Smith in branch 'master':
      bpo-39481: Make functools.cached_property, partial, partialmethod generic (bpo-19427)
      cecf049

    15. gvanrossum commented on Apr 14, 2020

      @gvanrossum
      MemberAuthor

      New changeset 8ef8750 by Ethan Smith in branch 'master':
      bpo-39481: Make weakref and WeakSet generic (GH-19497)
      8ef8750

    16. gvanrossum commented on Apr 14, 2020

      @gvanrossum
      MemberAuthor

      New changeset d01628e by Ethan Smith in branch 'master':
      bpo-39481: PEP-585 for dataclasses, mailbox, contextvars (GH-19425)
      d01628e

    17. ethanhs commented on Apr 15, 2020

      ethanhsmannequin
      Mannequin

      I went through the list I generated and it seems that the
      ipaddress._BaseNetwork and mmap.mmap cases are the only one I saw that
      shouldn't be generic. I will submit a PR to revert those. The only item
      left after that which I know of is _lru_cache_wrapper.

      On Tue, Apr 14, 2020 at 4:14 PM Guido van Rossum <report@bugs.python.org>
      wrote:

      Guido van Rossum <guido@python.org> added the comment:

      New changeset d01628e by Ethan Smith in
      branch 'master':
      bpo-39481: PEP-585 for dataclasses, mailbox, contextvars (GH-19425)

      d01628e

      ----------


      Python tracker <report@bugs.python.org>
      <https://bugs.python.org/issue39481\>


    18. gvanrossum commented on Apr 15, 2020

      @gvanrossum
      MemberAuthor

      Thanks!

      --Guido (mobile)

    19. gvanrossum commented on Apr 25, 2020

      @gvanrossum
      MemberAuthor

      In commit 0e80b56 a What's New section was added.

    20. gvanrossum commented on May 12, 2020

      @gvanrossum
      MemberAuthor

      New changeset f3a5b7a by Batuhan Taskaya in branch 'master':
      bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)
      f3a5b7a

    21. gvanrossum commented on Jul 25, 2020

      @gvanrossum
      MemberAuthor

      This can be closed. It needs docs though; there's a separate issue for that (bpo-40814).

    22. miss-islington commented on Oct 9, 2020

      @miss-islington
      Contributor

      New changeset b2c0a43 by Saiyang Gou in branch 'master':
      bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619)
      b2c0a43

    23. gvanrossum commented on Oct 12, 2020

      @gvanrossum
      MemberAuthor

      New changeset 1c21765 by Saiyang Gou in branch '3.9':
      [3.9] bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619) (bpo-22624)
      1c21765

    24. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions