eric6.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities
Module implementing some utility and compatibility functions for working with
the ast module.
Global Attributes
Classes
Functions
getValue |
Function to extract the value of a node. |
getValue |
Function to extract the value of a node. |
isBaseString |
Function to check that a node is a bytes or string. |
isBaseString |
Function to check that a node is a bytes or string. |
isBytes |
Function to check that a node is a bytes. |
isBytes |
Function to check that a node is a bytes. |
isNameConstant |
Function to check that a node is a name constant. |
isNameConstant |
Function to check that a node is a name constant. |
isNumber |
Function to check that a node is a number. |
isNumber |
Function to check that a node is a number. |
isString |
Function to check that a node is a string. |
isString |
Function to check that a node is a string. |
getValue
getValue(node)
Function to extract the value of a node.
- node (ast.Constant)
-
reference to the node to extract the value from
- Returns:
-
value of the node
- Return Type:
-
any
- Raises TypeError:
-
raised to indicate an unsupported type
getValue
getValue(node)
Function to extract the value of a node.
- node (one of ast.Num, ast.Str, ast.Bytes or ast.NameConstant)
-
reference to the node to extract the value from
- Returns:
-
value of the node
- Return Type:
-
one of str, bytes, int
- Raises TypeError:
-
raised to indicate an unsupported type
isBaseString
isBaseString(node)
Function to check that a node is a bytes or string.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a bytes or string
- Return Type:
-
bool
isBaseString
isBaseString(node)
Function to check that a node is a bytes or string.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a bytes or string
- Return Type:
-
bool
isBytes
isBytes(node)
Function to check that a node is a bytes.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a bytes
- Return Type:
-
bool
isBytes
isBytes(node)
Function to check that a node is a bytes.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a bytes
- Return Type:
-
bool
isNameConstant
isNameConstant(node)
Function to check that a node is a name constant.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a name constant
- Return Type:
-
bool
isNameConstant
isNameConstant(node)
Function to check that a node is a name constant.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a name constant
- Return Type:
-
bool
isNumber
isNumber(node)
Function to check that a node is a number.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a number
- Return Type:
-
bool
isNumber
isNumber(node)
Function to check that a node is a number.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a number
- Return Type:
-
bool
isString
isString(node)
Function to check that a node is a string.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a string
- Return Type:
-
bool
isString
isString(node)
Function to check that a node is a string.
- node (ast.AST)
-
reference to the node to check
- Returns:
-
flag indicating a string
- Return Type:
-
bool