Irit Katriel <iritkatr...@gmail.com> added the comment:

We probably do need better documentation for subclassing ExceptionGroup.

When you subclass an ExceptionGroup you want to make sure that split() and 
subgroup() (which are used by except*) will continue working, usually by 
defining a derive() method:

https://docs.python.org/3.11/library/exceptions.html#BaseExceptionGroup.derive

If you don't define derive the superclass constructor is used, which means you 
get something of type ExceptionGroup, not your subclass.


I don't know whether it's a good idea to make it easier to define a subclass 
that doesn't support split()/except* because ti changes the constructor 
signature without providing derive().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46431>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to