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

Document that collections.abc types are subscriptable #89612

Closed
FFY00 opened this issue Oct 12, 2021 · 6 comments
Closed

Document that collections.abc types are subscriptable #89612

FFY00 opened this issue Oct 12, 2021 · 6 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@FFY00
Copy link
Member

FFY00 commented Oct 12, 2021

BPO 45449
Nosy @gvanrossum, @ambv, @miss-islington, @FFY00, @Fidget-Spinner
PRs
  • bpo-45449: add note about PEP 585 in collections.abc's documentation #29047
  • [3.10] bpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047) #29067
  • [3.9] bpo-45449: add note about PEP 585 in collections.abc's documentation (GH-29047) #29068
  • 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-19.18:50:43.564>
    created_at = <Date 2021-10-12.17:11:41.595>
    labels = ['3.11', 'type-feature', '3.9', '3.10', 'docs']
    title = 'Document that collections.abc types are subscriptable'
    updated_at = <Date 2021-10-19.18:50:43.563>
    user = 'https://github.com/FFY00'

    bugs.python.org fields:

    activity = <Date 2021-10-19.18:50:43.563>
    actor = 'lukasz.langa'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-10-19.18:50:43.564>
    closer = 'lukasz.langa'
    components = ['Documentation']
    creation = <Date 2021-10-12.17:11:41.595>
    creator = 'FFY00'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45449
    keywords = ['patch']
    message_count = 6.0
    messages = ['403744', '403746', '404323', '404328', '404333', '404334']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'docs@python', 'lukasz.langa', 'miss-islington', 'FFY00', 'kj']
    pr_nums = ['29047', '29067', '29068']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue45449'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @FFY00
    Copy link
    Member Author

    FFY00 commented Oct 12, 2021

    Since 3.9, the types in collections.abc are subscriptable and can be used as type hints, but this is not documented.
    We should write something similar to what's on the typing module documentation for the deprecated types.

    @FFY00 FFY00 added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Oct 12, 2021
    @FFY00 FFY00 added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Oct 12, 2021
    @FFY00 FFY00 added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Oct 12, 2021
    @FFY00
    Copy link
    Member Author

    FFY00 commented Oct 12, 2021

    Just to clarify: some type checkers will still allow using them as type hints in Python versions before 3.9, but from __future__ import annotations needs to be used so that we don't error out at ruuntime.

    @ambv
    Copy link
    Contributor

    ambv commented Oct 19, 2021

    New changeset 7bafa0c by Filipe Laíns in branch 'main':
    bpo-45449: add note about PEP-585 in collections.abc's documentation (GH-29047)
    7bafa0c

    @ambv
    Copy link
    Contributor

    ambv commented Oct 19, 2021

    New changeset 092ec4b by Miss Islington (bot) in branch '3.10':
    bpo-45449: add note about PEP-585 in collections.abc's documentation (GH-29047) (GH-29067)
    092ec4b

    @ambv
    Copy link
    Contributor

    ambv commented Oct 19, 2021

    New changeset a18e4e9 by Łukasz Langa in branch '3.9':
    [3.9] bpo-45449: add note about PEP-585 in collections.abc's documentation (GH-29047) (GH-29068)
    a18e4e9

    @ambv
    Copy link
    Contributor

    ambv commented Oct 19, 2021

    Thanks, Filipe! ✨ 🍰 ✨

    @ambv ambv closed this as completed Oct 19, 2021
    @ambv ambv closed this as completed Oct 19, 2021
    @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 3.11 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