src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsFunctionVisitor.py

branch
eric7
changeset 9500
5771348ded12
parent 9276
e6748a5e24b9
child 9653
e67609152c5e
equal deleted inserted replaced
9499:dd389c57c2f0 9500:5771348ded12
116 @param argExpr DESCRIPTION 116 @param argExpr DESCRIPTION
117 @type ast.expr or str 117 @type ast.expr or str
118 @return flag indicating an annotation with 'typing.Any' 118 @return flag indicating an annotation with 'typing.Any'
119 @rtype bool 119 @rtype bool
120 """ 120 """
121 if isinstance(argExpr, ast.Name): 121 if isinstance(argExpr, ast.Name) and argExpr.id == "Any":
122 if argExpr.id == "Any": 122 return True
123 return True 123 elif isinstance(argExpr, ast.Attribute) and argExpr.attr == "Any":
124 elif isinstance(argExpr, ast.Attribute): 124 return True
125 if argExpr.attr == "Any": 125 elif isinstance(argExpr, str) and argExpr.split(".", maxsplit=1)[-1] == "Any":
126 return True 126 return True
127 elif isinstance(argExpr, str): # __IGNORE_WARNING_Y102__
128 if argExpr.split(".", maxsplit=1)[-1] == "Any":
129 return True
130 127
131 return False 128 return False
132 129
133 130
134 class Function: 131 class Function:

eric ide

mercurial