def set_attributes(self, doc, data_type):
self.raw_doc = doc<EOL>self.doc = doc_unwrap(doc)<EOL>self.data_type = data_type<EOL>cur_data_type = data_type<EOL>while is_alias(cur_data_type):<EOL><INDENT>cur_data_type = cur_data_type.data_type<EOL>if cur_data_type == self:<EOL><INDENT>raise InvalidSpec(<EOL>"<STR_LIT>" % self.name,<EOL>self._ast_node.lineno, self._ast_node.path)<EOL><DEDENT><DEDENT>
:param Optional[str] doc: Documentation string of alias.
:param data_type: The source data type referenced by the alias.