Skip to content

Missing class getitems in standard library classes #83200

Closed

Description

@isidentical
BPO 39019
Nosy @gvanrossum, @brettcannon, @serhiy-storchaka, @ilevkivskyi, @isidentical
PRs
  • bpo-39019: Implement missing __class_getitem__ for subprocess classes #17558
  • bpo-39019: Implement missing __class_getitem__ for SpooledTemporaryFile #17560
  • bpo-39019: Implement missing __class_getitem__ for os.DirEntry #17561
  • bpo-39019: Implement missing __class_getitem__ for http.cookies.Morsel #17563
  • 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-04-07.20:37:14.175>
    created_at = <Date 2019-12-10.17:55:54.056>
    labels = ['library', '3.9']
    title = 'Missing class getitems in standard library classes'
    updated_at = <Date 2020-04-07.20:55:44.241>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-04-07.20:55:44.241>
    actor = 'BTaskaya'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-04-07.20:37:14.175>
    closer = 'BTaskaya'
    components = ['Library (Lib)']
    creation = <Date 2019-12-10.17:55:54.056>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39019
    keywords = ['patch']
    message_count = 8.0
    messages = ['358209', '359043', '359044', '362530', '362533', '365937', '365941', '365942']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'brett.cannon', 'serhiy.storchaka', 'levkivskyi', 'BTaskaya']
    pr_nums = ['17558', '17560', '17561', '17563']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39019'
    versions = ['Python 3.9']

    Activity

    1. isidentical commented on Dec 10, 2019

      @isidentical
      SponsorMemberAuthor

      After working on bpo-38994 and bpo-38978, I decided to write a simple AST analyzer to find class getitem syntax usage in typeshed. It discovered a few classes (I am not sure if there are more). As @brett.cannon suggested in PR 17498 I'll prepare individual pull requests.

      typeshed/stdlib/3/subprocess.pyi:868 => Popen
      typeshed/stdlib/3/subprocess.pyi:82 => CompletedProcess
      typeshed/stdlib/3/tempfile.pyi:98 => SpooledTemporaryFile
      typeshed/stdlib/3/os/init.pyi:463 => DirEntry
      typeshed/stdlib/3/http/cookies.pyi:5 => Morsel

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Dec 10, 2019
    3. ilevkivskyi commented on Dec 30, 2019

      @ilevkivskyi
      Member

      New changeset 4dc5a9d by Ivan Levkivskyi (Batuhan Taşkaya) in branch 'master':
      bpo-39019: Implement missing __class_getitem__ for subprocess classes (GH-17558)
      4dc5a9d

    4. ilevkivskyi commented on Dec 30, 2019

      @ilevkivskyi
      Member

      New changeset 09c482f by Ivan Levkivskyi (Batuhan Taşkaya) in branch 'master':
      bpo-39019: Implement missing __class_getitem__ for SpooledTemporaryFile (GH-17560)
      09c482f

    5. gvanrossum commented on Feb 23, 2020

      @gvanrossum
      Member

      Once PEP-585 is implemented these should be rolled back and replaced with that, right?

    6. ilevkivskyi commented on Feb 23, 2020

      @ilevkivskyi
      Member

      Once PEP-585 is implemented these should be rolled back and replaced with that, right?

      I would say that ideally yes.

    7. isidentical commented on Apr 7, 2020

      @isidentical
      SponsorMemberAuthor

      PEP-585 is landed, closing the issue (and linked PRs)

    8. gvanrossum commented on Apr 7, 2020

      @gvanrossum
      Member

      Hold on, os.DirEntry[str] still doesn't work.

    9. isidentical commented on Apr 7, 2020

      @isidentical
      SponsorMemberAuthor

      Hold on, os.DirEntry[str] still doesn't work.

      That is what I asked on the bpo-39481. I couldn't find anything about its cover on PEP-585.

    10. 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 lifestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions