Skip to content
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

The list of standard generic collections is incomplete #86446

Closed
jack1142 mannequin opened this issue Nov 6, 2020 · 6 comments
Closed

The list of standard generic collections is incomplete #86446

jack1142 mannequin opened this issue Nov 6, 2020 · 6 comments
Labels
3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@jack1142
Copy link
Mannequin

jack1142 mannequin commented Nov 6, 2020

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']

    @jack1142
    Copy link
    Mannequin Author

    jack1142 mannequin commented Nov 6, 2020

    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)

    @jack1142 jack1142 mannequin added 3.9 only security fixes 3.10 only security fixes labels Nov 6, 2020
    @jack1142 jack1142 mannequin assigned docspython Nov 6, 2020
    @jack1142 jack1142 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.9 only security fixes 3.10 only security fixes labels Nov 6, 2020
    @jack1142 jack1142 mannequin assigned docspython Nov 6, 2020
    @jack1142 jack1142 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Nov 6, 2020
    @Fidget-Spinner
    Copy link
    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.

    @gvanrossum
    Copy link
    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?).

    @jack1142
    Copy link
    Mannequin Author

    jack1142 mannequin commented Nov 16, 2020

    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.

    @gvanrossum
    Copy link
    Member

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

    @Fidget-Spinner
    Copy link
    Member

    I concur with Guido to close this.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants