What is the difference between ConfigDict
and dict
?
ConfigDict: TypeAlias = dict[str, Union[str, list[str]]]
What are the advantages of using ConfigDict
?
ConfigDict
in the PR you linked to is a type alias to a dict
where the key is a string and the value is either a string or a list of strings.
In runtime, there isn't any functional difference. It's mainly useful in development time to save having to type the long dict
definition each time and to avoid mistakenly using a different definition (e.g., using dict(str, str)
by mistake.