(value: cst.BaseExpression)
| 61 | |
| 62 | |
| 63 | def cst_to_python(value: cst.BaseExpression) -> Any: |
| 64 | if isinstance(value, cst.List): |
| 65 | return [cst_to_python(item.value) for item in value.elements] |
| 66 | if isinstance(value, cst.SimpleString): |
| 67 | return value.evaluated_value |
| 68 | if isinstance(value, cst.Name): |
| 69 | if value.value == "True": |
| 70 | return True |
| 71 | if value.value == "False": |
| 72 | return False |
| 73 | raise ValueError(f"unsupported expr: {value}") |
| 74 | |
| 75 | |
| 76 | def as_python_type( |
no outgoing calls
no test coverage detected
searching dependent graphs…