[issue46431] Trouble subclassing ExceptionGroup

Irit Katriel report at bugs.python.org
Mon Jan 24 10:42:15 EST 2022


Irit Katriel <iritkatriel at gmail.com> added the comment:

The error message isn't always this bad:

>>> class Base:
...     def __new__(cls, a, b, c):
...        cls.newargs = (a,b,c)
...     
... 
>>> class Derived(Base):
...     def __init__(self, x):
...         super().__init__(x)
...         self.initargs = (x,)
... 
>>> Derived(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Base.__new__() missing 2 required positional arguments: 'b' and 'c'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46431>
_______________________________________


More information about the Python-bugs-list mailing list