-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
I think the typing used in this project could be improved. The way it is currently, it causes troubles to users. For example to_container
returns a very broad type and the user has to cast the output to make sure the code does not throw errors.
@staticmethod
def to_container(
cfg: Any,
*,
resolve: bool = False,
throw_on_missing: bool = False,
enum_to_str: bool = False,
structured_config_mode: SCMode = SCMode.DICT,
) -> Union[Dict[DictKeyType, Any], List[Any], None, str, Any]:
Also, I would definitely not make cfg
an Any
. It must be something, a list, dictionary, something.
Describe the solution you'd like
In cases like this I would use overloads to make sure that the types going in and going out are under control and unambiguous.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Metadata
Metadata
Assignees
Labels
No labels