def get_constructor_attributes_types(item_type) -> Dict[str, Tuple[Type[Any], bool]]:
res = dict()<EOL>try:<EOL><INDENT>from parsyfiles.plugins_optional.support_for_attrs import get_attrs_declarations<EOL>decls = get_attrs_declarations(item_type)<EOL>for attr_name, v in decls.items():<EOL><INDENT>typ, is_optional = v<EOL>typ = get_validated_attribute_type_info(typ, item_type, attr_name)<EOL>is_optional = is_optional or is_pep484_nonable(typ)<EOL>res[attr_name] = (typ, not is_optional)<EOL><DEDENT>return res<EOL><DEDENT>except:  <EOL><INDENT>pass  <EOL><DEDENT>s = _get_constructor_signature(item_type)<EOL>for attr_name in s.parameters.keys():<EOL><INDENT>if attr_name != '<STR_LIT>':<EOL><INDENT>typ = get_validated_attribute_type_info(s.parameters[attr_name].annotation, item_type, attr_name)<EOL>is_mandatory = (s.parameters[attr_name].default is Parameter.empty) and not is_pep484_nonable(typ)<EOL>res[attr_name] = (typ, is_mandatory)<EOL><DEDENT><DEDENT>return res<EOL>
Utility method to return a dictionary of attribute name > attribute type from the constructor of a given type
It supports PEP484 and 'attrs' declaration, see https://github.com/python-attrs/attrs.

:param item_type:
:return: a dictionary containing for each attr name, a tuple (type, is_mandatory)