module documentation
Undocumented
| Function | get |
Given an ast.Name instance with Store context and it's assignment statement, figure out the right hand side expression that is stored in the symbol. |
def get_stored_value(node:
ast.Name | ast.Attribute, assign: ast.Assign | ast.AnnAssign) -> ast.expr | None:
(source)
ΒΆ
Given an ast.Name instance with Store context and it's assignment statement, figure out the right hand side expression that is stored in the symbol.
- Limitation:
- Since this function is mainly used to evaluate constant values, starred assignments are not supported as they ususally mean we're unpacking something of variable lenght.
- Nested tuple assignments are not supported.
- For loops targets are not supported by this function, it need to return an object that represent an expression of type T, not the expression itself, since it usually have multiple values.
| Raises | |
StaticCodeUnsupported | If there is no obvious value |