class ast_pattern_compilation_error¶
Describe an error in compiling an ast_pattern .
Will be thrown by ast_pattern constructor if:
patternis not properly formed.patternincludes an operation on a value of incorrect type.
ast_pattern_compilation_error Members¶
| Constructors | none |
| Methods | __hash__(), __repr__(), __str__(), get_pattern() |
ast_pattern_compilation_error Details¶
-
class
cs.ast_pattern_compilation_error¶ Describe an error in compiling an
ast_pattern.-
__hash__()¶ Get a hash value for a
ast_pattern_compilation_error.Return type: int >>> try: ... mypat = ast_pattern('((bad pattern)') ... except ast_pattern_compilation_error as e: ... print('string =', str(e)) ... print('hash =', hash(e)) ... string = ast_pattern compilation error: `expected ast-class typed pattern, but found ast typed pattern' near `(bad pattern)' hash = 1
-
__repr__()¶ Get a representation of a
ast_pattern_compilation_errorobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> try: >>> ast_pattern(')') >>> except ast_pattern_compilation_error as e: >>> v0 = e >>> repr(v0) "<cs.ast_pattern_compilation_error ast_pattern compilation error: `extra characters after end of pattern' near `)'>"
-
__str__()¶ Get a simple string representation of a
ast_pattern_compilation_errorobject.Return type: str Returns: The string representation. >>> try: >>> ast_pattern(')') >>> except ast_pattern_compilation_error as e: >>> v0 = e >>> str(v0) "ast_pattern compilation error: `extra characters after end of pattern' near `)'"
-
get_pattern()¶ Get a string rendering of the
ast_pattern.Return type: str Returns: The rendering, as a string. >>> try: >>> ast_pattern(')') >>> except ast_pattern_compilation_error as e: >>> v0 = e >>> v0.get_pattern() ')'
-