src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/AstUtilities.py

branch
eric7
changeset 10052
041d0785dd42
parent 9653
e67609152c5e
child 10119
64147a7e6393
equal deleted inserted replaced
10051:1128cb7bbb42 10052:041d0785dd42
71 """ 71 """
72 return isinstance(node, ast.Constant) and not isinstance( 72 return isinstance(node, ast.Constant) and not isinstance(
73 node.value, (bytes, str, numbers.Number) 73 node.value, (bytes, str, numbers.Number)
74 ) 74 )
75 75
76 def isEllipsis(node):
77 """
78 Function to check that a node is an ellipsis.
79
80 @param node reference to the node to check
81 @type ast.AST
82 @return flag indicating an ellipsis
83 @rtype bool
84 """
85 return isinstance(node, ast.Constant) and node.value is Ellipsis
86
76 def getValue(node): 87 def getValue(node):
77 """ 88 """
78 Function to extract the value of a node. 89 Function to extract the value of a node.
79 90
80 @param node reference to the node to extract the value from 91 @param node reference to the node to extract the value from
144 @return flag indicating a name constant 155 @return flag indicating a name constant
145 @rtype bool 156 @rtype bool
146 """ 157 """
147 return isinstance(node, ast.NameConstant) 158 return isinstance(node, ast.NameConstant)
148 159
160 def isEllipsis(node):
161 """
162 Function to check that a node is an ellipsis.
163
164 @param node reference to the node to check
165 @type ast.AST
166 @return flag indicating an ellipsis
167 @rtype bool
168 """
169 return isinstance(node, ast.Ellipsis)
170
149 def getValue(node): 171 def getValue(node):
150 """ 172 """
151 Function to extract the value of a node. 173 Function to extract the value of a node.
152 174
153 @param node reference to the node to extract the value from 175 @param node reference to the node to extract the value from

eric ide

mercurial