[Python-ideas] Re: dataclass field argument to allow converting value on init

2022-07-02 Thread Dexter Hill
That's clever, I'm a fan of that syntax. Quick question on it though - If you provide a `default` or `default_factory` to `field`, as well as `init_using`, how would that be handled? I'm thinking, `default_factory` would be made mutually exclusive, so you couldn't use it but `default` would

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-02 Thread Stephen J. Turnbull
Jelle Zijlstra writes: > In fact, `typing.Optional` means that something can be None, *not* > that it is an optional argument. You're missing my point. Yes, the *implementation* is that the object can be None. But that's far more clearly expressed by Union[T, None] if that's what you *mean*,