KEMBAR78
[mypyc] Support ellipsis (...) expressions in class bodies by Newbytee · Pull Request #17923 · python/mypy · GitHub
Skip to content

Conversation

Newbytee
Copy link
Contributor

This can be used to declare concise custom exceptions, e.g.

class UnknownReleaseError(ValueError): ...

which otherwise probably would be written

class UnknownReleaseError(ValueError):
    pass

and is supported by CPython.

Closes mypyc/mypyc#1069

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Some minor things, looks good overall.

Newbytee and others added 2 commits October 11, 2024 21:25
This can be used to declare concise custom exceptions, e.g.

    class UnknownReleaseError(ValueError): ...

which otherwise probably would be written

    class UnknownReleaseError(ValueError):
        pass

and is supported by CPython.

Closes mypyc/mypyc#1069
@Newbytee Newbytee requested a review from JukkaL October 12, 2024 11:10
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@JukkaL JukkaL merged commit 395108d into python:master Oct 14, 2024
13 checks passed
@Newbytee Newbytee deleted the ellipsis-class branch October 14, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doesn't understand empty class bodies with an ellipsis instead of "pass"

3 participants