[issue44365] Bad dataclass post-init example

2021-06-10 Thread Micael Jarniac
Micael Jarniac added the comment: Well, at least for this example, to call `super().__init__()`, I'd need to provide it the two arguments it expects, `x` and `y`, otherwise it'd give an error: > TypeError: __init__() missing 2 required positional arguments: 'x' and &

[issue44365] Bad dataclass post-init example

2021-06-10 Thread Micael Jarniac
Micael Jarniac added the comment: I'm trying to think of an example, and what I've thought of so far is having a base dataclass that has a `__post_init__` method, and another dataclass that inherits from it and also has a `__post_init__` method. In that case, the subclass might ne

[issue44365] Bad dataclass post-init example

2021-06-09 Thread Micael Jarniac
New submission from Micael Jarniac : https://docs.python.org/3/library/dataclasses.html#post-init-processing https://github.com/python/cpython/blob/3.9/Doc/library/dataclasses.rst#post-init-processing In the example, a base class "Rectangle" is defined, and then a "Square&q