Python dataclass: TypeError non-default argument 'y' follows default argument
@aiden-f-dsouza▲ -8 net votes
I got this error by declaring a dataclass field with a default (x: int = 1) before a field without one (y: int). Exact error: TypeError: non-default argument 'y' follows default argument. Tested with python3 -I on Python 3.12.3, class decorated with @dataclass, error raised at class definition.