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

Using collections ABC from collections.abc rather than collections in 2to3 converted code #74329

Closed
serhiy-storchaka opened this issue Apr 23, 2017 · 4 comments
Labels
3.7 (EOL) end of life topic-2to3 type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 30143
Nosy @rhettinger, @benjaminp, @serhiy-storchaka
PRs
  • bpo-30143: 2to3 now generates a code that uses abstract collection classes #1262
  • 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 2017-11-16.07:19:42.040>
    created_at = <Date 2017-04-23.12:11:25.685>
    labels = ['3.7', 'type-feature', 'expert-2to3']
    title = 'Using collections ABC from collections.abc rather than collections in 2to3 converted code'
    updated_at = <Date 2017-11-16.07:19:42.040>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-11-16.07:19:42.040>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-16.07:19:42.040>
    closer = 'serhiy.storchaka'
    components = ['2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2017-04-23.12:11:25.685>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30143
    keywords = []
    message_count = 4.0
    messages = ['292163', '306279', '306282', '306341']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'benjamin.peterson', 'serhiy.storchaka']
    pr_nums = ['1262']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30143'
    versions = ['Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    Proposed patch makes 2to3 generating a code that uses abstract collection classes Sequence and Mapping from collections.abc rather than collections. Since abstract collection classes now are defined in collections.abc and collections contains only aliases for compatibility, this is more idiomatic Python 3 code.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life topic-2to3 type-feature A feature request or enhancement labels Apr 23, 2017
    @serhiy-storchaka
    Copy link
    Member Author

    What are your thoughts about this Benjamin?

    @rhettinger
    Copy link
    Contributor

    +1 I think this change will be essential. IIRC, elsewhere Guido approved a 3.7 change so that the ABC will no longer be visible in collections.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 0a2abdf by Serhiy Storchaka in branch 'master':
    bpo-30143: 2to3 now generates a code that uses abstract collection classes (bpo-1262)
    0a2abdf

    @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.7 (EOL) end of life topic-2to3 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants