struct.Struct inheritance with Python 3.12.0
Bug report
Bug description:
import struct class MyStruct(struct.Struct): def __init__(self): super().__init__('>h') obj = MyStruct()
When I run this code I receive an error:
Traceback (most recent call last):
File "/home/user/bug.py", line 7, in <module>
obj = MyStruct()
^^^^^^^^^^
TypeError: Struct() missing required argument 'format' (pos 1)
It is rather strange error, I have passed format parameter to base class constructor, I receive this error with any value of format parameter.
There are no any problems with this code in Python 3.11 and older.
CPython versions tested on:
3.12
Operating systems tested on:
Linux