|
|
@ -176,21 +176,13 @@ def get_assign_annotation(node):
|
|
|
|
:returns: The type annotation as a string, or None if one does not exist.
|
|
|
|
:returns: The type annotation as a string, or None if one does not exist.
|
|
|
|
:rtype: str or None
|
|
|
|
:rtype: str or None
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
annotation = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
annotation_node = None
|
|
|
|
annotation_node = None
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
annotation_node = node.annotation
|
|
|
|
annotation_node = node.annotation
|
|
|
|
except AttributeError:
|
|
|
|
except AttributeError:
|
|
|
|
annotation_node = node.type_annotation
|
|
|
|
annotation_node = node.type_annotation
|
|
|
|
|
|
|
|
|
|
|
|
if annotation_node:
|
|
|
|
return format_annotation(annotation_node, node)
|
|
|
|
if isinstance(annotation_node, astroid.nodes.Const):
|
|
|
|
|
|
|
|
annotation = node.value
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
annotation = annotation_node.as_string()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return annotation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_decorated_with_property(node):
|
|
|
|
def is_decorated_with_property(node):
|
|
|
|