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

dataclasses: disallow inheritance between frozen and non-frozen classes #77141

Closed
ericvsmith opened this issue Feb 26, 2018 · 4 comments
Closed
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ericvsmith
Copy link
Member

BPO 32960
Nosy @ericvsmith
PRs
  • bpo-32960: dataclasses disallow frozen inheritance #5919
  • [3.7] bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen classes and vice-versa, (GH-5919) #5920
  • 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 = 'https://github.com/ericvsmith'
    closed_at = <Date 2018-03-19.01:29:30.902>
    created_at = <Date 2018-02-26.23:41:26.157>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'dataclasses: disallow inheritance between frozen and non-frozen classes'
    updated_at = <Date 2018-03-19.01:29:30.896>
    user = 'https://github.com/ericvsmith'

    bugs.python.org fields:

    activity = <Date 2018-03-19.01:29:30.896>
    actor = 'eric.smith'
    assignee = 'eric.smith'
    closed = True
    closed_date = <Date 2018-03-19.01:29:30.902>
    closer = 'eric.smith'
    components = ['Library (Lib)']
    creation = <Date 2018-02-26.23:41:26.157>
    creator = 'eric.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32960
    keywords = ['patch']
    message_count = 4.0
    messages = ['312972', '312973', '312978', '314073']
    nosy_count = 1.0
    nosy_names = ['eric.smith']
    pr_nums = ['5919', '5920']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32960'
    versions = ['Python 3.7', 'Python 3.8']

    @ericvsmith
    Copy link
    Member Author

    This is a temporary measure until we can better define how frozen inheritance should work. In the meantime, disallow:

    • frozen inherited from non-frozen
    • non-frozen inherited from frozen

    @ericvsmith ericvsmith added 3.7 (EOL) end of life 3.8 only security fixes labels Feb 26, 2018
    @ericvsmith ericvsmith self-assigned this Feb 26, 2018
    @ericvsmith ericvsmith added the stdlib Python modules in the Lib dir label Feb 26, 2018
    @ericvsmith
    Copy link
    Member Author

    See bpo-32953 for a larger discussion and the ultimate resolution of this.

    @ericvsmith
    Copy link
    Member Author

    New changeset a93e3dc by Eric V. Smith (Miss Islington (bot)) in branch '3.7':
    bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen classes and vice-versa, (GH-5919) (GH-5920)
    a93e3dc

    @ericvsmith
    Copy link
    Member Author

    Resolved by bpo-32953.

    @ericvsmith ericvsmith added the type-bug An unexpected behavior, bug, or error label Mar 19, 2018
    @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 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant