Skip to content

The list of standard generic collections is incomplete #86446

Closed

Description

@jack1142
mannequin
BPO 42280
Nosy @gvanrossum, @ilevkivskyi, @jack1142, @Fidget-Spinner, @AlexWaygood
PRs
  • bpo-42280: Clarify docs on standard generic collections #29308
  • 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 2021-10-20.15:57:30.982>
    created_at = <Date 2020-11-06.18:49:58.028>
    labels = ['type-feature', '3.9', '3.10', 'docs']
    title = 'The list of standard generic collections is incomplete'
    updated_at = <Date 2021-10-29.14:11:57.475>
    user = 'https://github.com/jack1142'

    bugs.python.org fields:

    activity = <Date 2021-10-29.14:11:57.475>
    actor = 'AlexWaygood'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-10-20.15:57:30.982>
    closer = 'kj'
    components = ['Documentation']
    creation = <Date 2020-11-06.18:49:58.028>
    creator = 'jack1142'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42280
    keywords = []
    message_count = 6.0
    messages = ['380467', '380507', '381052', '381055', '381056', '404480']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'docs@python', 'levkivskyi', 'jack1142', 'kj', 'AlexWaygood']
    pr_nums = ['29308']
    priority = 'normal'
    resolution = 'wont fix'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42280'
    versions = ['Python 3.9', 'Python 3.10']

    Activity

    1. jack1142 commented on Nov 6, 2020

      jack1142mannequin
      MannequinAuthor

      It looks like the documentation lists standard library collections that support parameterized generics[1] however, it seems to only feature a part of all the collections that support parametrizing (I'm going by the list that was produced by Ethan Smith[2], it could be slightly inaccurate now, but that can be cross-checked when making the contribution).

      I would be interested in making a PR adding these if/when this issue gets accepted.

      [1] https://docs.python.org/3.10/library/stdtypes.html#standard-generic-collections
      [2] gvanrossum#1 (comment)

    2. added
      3.9 (EOL)
      3.10 (EOL)
      on Nov 6, 2020
    3. added
      docs
      type-feature
      3.9 (EOL)
      3.10 (EOL)
      on Nov 6, 2020
    4. added
      docs
      type-feature
      on Nov 6, 2020
    5. Fidget-Spinner commented on Nov 7, 2020

      @Fidget-Spinner
      Member

      Dear Jack, good catch! My only worry is that if we make the list exhaustive, it would be too lengthy, or that it might not be feasible to continuously update it every time a new generic type supports the feature.

      Maybe a line somewhere to mention that most container types in Python should support the feature, and that the list provided is non-exhaustive should suffice?

      I'm not sure, nosy-ing Guido and Ivan to the list for their thoughts on this.

    6. gvanrossum commented on Nov 16, 2020

      @gvanrossum
      Member

      I think the difference between the two lists is that not every generic type is a collection.

      If we apply that standard, I think the contextlib and re classes need to be *removed* from the list (did I get that right?).

    7. jack1142 commented on Nov 16, 2020

      jack1142mannequin
      MannequinAuthor

      I was thinking that this could be the case but if I'm not mistaken, there's actually quite a lot of types in this list that aren't collections (awaitable, coroutine, iterable, iterator, generator, the async versions of those, callable, *hmm, are views collections?, and the ones you mentioned), so I figured that listing *only collections might have not been the intention when this was written. But listing all of the generics in Python would indeed be lengthy so it might make sense to limit it to collections nonetheless, I'm not really sure about it though.

    8. gvanrossum commented on Nov 16, 2020

      @gvanrossum
      Member

      Let’s just close this, there are more important things to do.

    9. Fidget-Spinner commented on Oct 20, 2021

      @Fidget-Spinner
      Member

      I concur with Guido to close this.

    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.10 (EOL)3.9 (EOL)docstype-feature

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions