
June 24, 2022
5:16 p.m.
Simão Afonso wrote:
On 2022-06-23 17:35:59, Steve Jorgensen wrote:
What if, instead, the `init` parameter could accept either a boolean (as it does now) or a type? When given a type, that would mean that to created the property and accept the argument but pass the argument ti `__post_init__` rather than using it to initialize the property directly. The type passed to `init` would become the type hint for the argument. What if you wanted to create a boolean type from a function? Then you would pass `type=bool`