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

ExceptionGroup.split()/subgroup() don't copy __note__ to parts #90265

Closed
iritkatriel opened this issue Dec 16, 2021 · 3 comments
Closed

ExceptionGroup.split()/subgroup() don't copy __note__ to parts #90265

iritkatriel opened this issue Dec 16, 2021 · 3 comments
Assignees
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@iritkatriel
Copy link
Member

BPO 46107
Nosy @iritkatriel
PRs
  • bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts #30159
  • 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/iritkatriel'
    closed_at = <Date 2021-12-21.10:17:55.459>
    created_at = <Date 2021-12-16.22:36:49.923>
    labels = ['interpreter-core', 'type-bug', '3.11']
    title = "ExceptionGroup.split()/subgroup() don't copy __note__ to parts"
    updated_at = <Date 2021-12-21.10:17:55.459>
    user = 'https://github.com/iritkatriel'

    bugs.python.org fields:

    activity = <Date 2021-12-21.10:17:55.459>
    actor = 'iritkatriel'
    assignee = 'iritkatriel'
    closed = True
    closed_date = <Date 2021-12-21.10:17:55.459>
    closer = 'iritkatriel'
    components = ['Interpreter Core']
    creation = <Date 2021-12-16.22:36:49.923>
    creator = 'iritkatriel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46107
    keywords = ['patch']
    message_count = 3.0
    messages = ['408740', '408742', '408997']
    nosy_count = 1.0
    nosy_names = ['iritkatriel']
    pr_nums = ['30159']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46107'
    versions = ['Python 3.11']

    @iritkatriel
    Copy link
    Member Author

    >>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
    >>> e.__note__ = "a note"
    >>> e.split(ValueError)
    (ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
    >>> e.split(ValueError)[0].__note__
    >>> e.subgroup(ValueError).__note__

    @iritkatriel iritkatriel added 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Dec 16, 2021
    @iritkatriel
    Copy link
    Member Author

    With the patch:

    >>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
    >>> e.__note__ = "a note"
    >>> e.split(ValueError)
    (ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
    >>> e.split(ValueError)[0].__note__
    'a note'
    >>> e.split(ValueError)[1].__note__
    'a note'
    >>> e.subgroup(ValueError).__note__
    'a note'
    >>>

    @iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error labels Dec 16, 2021
    @iritkatriel
    Copy link
    Member Author

    New changeset c66fc0f by Irit Katriel in branch 'main':
    bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts (GH-30159)
    c66fc0f

    @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.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant