Skip to content

[mypyc] Support ellipsis (...) expressions in class bodies#17923

Merged
JukkaL merged 3 commits intopython:masterfrom
Newbytee:ellipsis-class
Oct 14, 2024
Merged

[mypyc] Support ellipsis (...) expressions in class bodies#17923
JukkaL merged 3 commits intopython:masterfrom
Newbytee:ellipsis-class

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