
June 23, 2022
3:13 a.m.
On 2022-06-23 00:03:03, Paul Bryan wrote:
What type hint will be exposed for the __init__ parameter? Clearly, it's not a `str` type in your example; you're passing it an `int` value in your example. Presumably to overcome this, you'd need yet another `field` function parameter to provide the type hint for the `__init__` param?
Can't this be derived from the type `default_factory` function? `chr` is something like:
def chr(num: int) -> str:
So that type should be `int`.