Closed jbasko closed 6 years ago
No, the fields
function is supposed to return exactly what you gave it. It is agnostic of the meaning of type hints. To get the actual types of the fields, use typing.get_type_hints(CurrencyAmount)
instead. Only that function resolves forward references at runtime.
Oh, ok. get_type_hints
is exactly what I needed, thanks!
I'm on Python 3.6.6
Maybe I'm using typing incorrectly, but isn't the type information of
amount
in the code below supposed to not forget that it's anint
?