def _is_valid_for_dict_to_object_conversion(strict_mode: bool, from_type: Type, to_type: Type) -> bool:
<EOL>try:<EOL><INDENT>res, subclasses_hash = _cache_valid_for_dict_to_object[to_type][strict_mode]<EOL>if not strict_mode and to_type is not None and not is_any_type(to_type):<EOL><INDENT>if hash(tuple(get_all_subclasses(to_type))) != subclasses_hash:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>except KeyError:<EOL><INDENT>res = __is_valid_for_dict_to_object_conversion(strict_mode=strict_mode, from_type=from_type, to_type=to_type)<EOL>subclasses_hash = None<EOL>if not strict_mode and to_type is not None and not is_any_type(to_type):<EOL><INDENT>subclasses_hash = hash(tuple(get_all_subclasses(to_type)))<EOL><DEDENT>entry = (res, subclasses_hash)<EOL>try:<EOL><INDENT>_cache_valid_for_dict_to_object[to_type][strict_mode] = entry<EOL><DEDENT>except KeyError:<EOL><INDENT>_cache_valid_for_dict_to_object[to_type] = {strict_mode: entry}<EOL><DEDENT><DEDENT>return res<EOL>
Returns true if the provided types are valid for dict_to_object conversion

Explicitly declare that we are not able to parse collections nor able to create an object from a dictionary if the
object's constructor is non correctly PEP484-specified.

None should be treated as a Joker here (but we know that never from_type and to_type will be None at the same time)

:param strict_mode:
:param from_type:
:param to_type:
:return: