A minimal example to reproduce my problem:
from decimal import Decimal
class MyDecimal(Decimal):
def __init__(self, value, dummy):
super().__init__(value)
print(dummy)
x = MyDecimal(5, 'test')
Throws:
TypeError: optional argument must be a context
A similar issue is described in this question, but the answer suggests that this is a bug which was fixed on Python 3.3, and I'm using Python 3.9.
Any idea what I'm doing wrong here, or how else I can inherit class Decimal
while using a different constructor prototype in my class (i.e., additional input arguments before and after the input argument passed to the base class upon construction)?