Dec 7, 2020
Hi,
Let's say you have a list as follows:
['1', '2', '3']
It will parse it as it is if you are using the built-in pydantic list
simple_list: list = None
On the other hand, typing.List allows you to set sub-type constraint.
['1', '2', '3']
Can be parsed as [1, 2, 3] if you specify it as
simple_list: List[int] = None
each string elements inside it will be casted to integer instead.