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

Change GeneratorExit's base class from Exception to BaseException #45878

Closed
aegis mannequin opened this issue Dec 2, 2007 · 11 comments
Closed

Change GeneratorExit's base class from Exception to BaseException #45878

aegis mannequin opened this issue Dec 2, 2007 · 11 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@aegis
Copy link
Mannequin

aegis mannequin commented Dec 2, 2007

BPO 1537
Nosy @gvanrossum, @pitrou, @tiran
Files
  • GeneratorExit-BaseException.patch
  • GeneratorExit-BaseException-2.patch
  • 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/tiran'
    closed_at = <Date 2007-12-03.20:03:23.142>
    created_at = <Date 2007-12-02.07:08:01.997>
    labels = ['interpreter-core', 'type-bug']
    title = "Change GeneratorExit's base class from Exception to BaseException"
    updated_at = <Date 2007-12-03.20:10:31.358>
    user = 'https://bugs.python.org/aegis'

    bugs.python.org fields:

    activity = <Date 2007-12-03.20:10:31.358>
    actor = 'aegis'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2007-12-03.20:03:23.142>
    closer = 'christian.heimes'
    components = ['Interpreter Core']
    creation = <Date 2007-12-02.07:08:01.997>
    creator = 'aegis'
    dependencies = []
    files = ['8850', '8855']
    hgrepos = []
    issue_num = 1537
    keywords = ['patch']
    message_count = 11.0
    messages = ['58079', '58083', '58085', '58086', '58096', '58097', '58138', '58139', '58143', '58151', '58152']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'aegis', 'pitrou', 'christian.heimes']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1537'
    versions = ['Python 2.6']

    @aegis
    Copy link
    Mannequin Author

    aegis mannequin commented Dec 2, 2007

    Per discussion at http://mail.python.org/pipermail/python-dev/2007-
    December/075498.html, this patch changes GeneratorExit's base class
    from Exception to BaseException.

    I updated the tests and documentation, but I may have missed any other
    discussion of GeneratorExit in the documentation. Happy to update the
    patch if there is any feedback.

    @aegis aegis mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Dec 2, 2007
    @tiran
    Copy link
    Member

    tiran commented Dec 2, 2007

    Can you also add a comment to ./Doc/reference/expressions.rst and update
    Misc/NEWS please? The rest of the patch is looking good.

    @tiran tiran self-assigned this Dec 2, 2007
    @pitrou
    Copy link
    Member

    pitrou commented Dec 2, 2007

    I'm not sure this change is necessary. Why don't you catch StandardError
    instead of Exception? StandardError catches all Exception subtypes
    except GeneratorExit, StopIteration and the various Warnings.

    @tiran
    Copy link
    Member

    tiran commented Dec 2, 2007

    You make a good point. Can you take it to the mailing list, please?

    @aegis
    Copy link
    Mannequin Author

    aegis mannequin commented Dec 2, 2007

    The mailing list discussion continues... in the meantime, I will
    update the patch with your suggestions.

    Can you describe to me what should change in Doc/reference/
    expressions.rst? It makes sense to remove the section in the example
    that says you should never catch GeneratorExit. Should I mention
    anything about why?

    @aegis
    Copy link
    Mannequin Author

    aegis mannequin commented Dec 2, 2007

    New patch...

    @gvanrossum
    Copy link
    Member

    looks good to me. Crys, can you do the honors?

    @gvanrossum
    Copy link
    Member

    Oops, some tests fail. ctypes and hotshot at least.

    @gvanrossum
    Copy link
    Member

    I take it back, that was a build error. After cleaning out the build
    directory the hotshot and ctypes tests pass.

    @tiran
    Copy link
    Member

    tiran commented Dec 3, 2007

    Applied in r59300 to the trunk. (This time for real. At first I
    committed it together with some junk to py3k branch. :/)

    @tiran tiran closed this as completed Dec 3, 2007
    @aegis
    Copy link
    Mannequin Author

    aegis mannequin commented Dec 3, 2007

    Fantastic, thank you!

    @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
    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

    3 participants