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

Warn on ExceptionGroup subclass without derive #334

Open
A5rocks opened this issue Dec 30, 2024 · 1 comment
Open

Warn on ExceptionGroup subclass without derive #334

A5rocks opened this issue Dec 30, 2024 · 1 comment

Comments

@A5rocks
Copy link

A5rocks commented Dec 30, 2024

While there's probably some usecase which makes sense for this, at most someone could just implement like so:

class CustomEG(ExceptionGroup):
  def derive(self, exs):
    return ExceptionGroup(self.message, exs)

to get the original behavior (I think). From python-trio/trio#3175

@jakkdl
Copy link
Member

jakkdl commented Dec 30, 2024

I was thinking that maybe this would fit better in flake8-bugbear due to being exceptiongroup-related and not necessarily async-specific, but given #302, #311, #301, #298 I think the best approach is creating a new 4xx series of rules for exceptiongroup-specific warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants