module documentation

Evaluate subtrees corresponding to python literals. This is a modified copy of typed_ast.ast3.literal_eval. The latter doesn't handle Name nodes, so it would not handle something like "{'type': A}". Our version converts that to "{'type': 'A'}" which is consistent with auto-stringifying type annotations. We also separate out string and node evaluation into separate functions.

Function eval_string_literal Undocumented
Function literal_eval Modified version of ast3.literal_eval, handling things like typenames.
Function _convert Helper function for literal_eval.
Constant _NUM_TYPES Undocumented
def eval_string_literal(src: str): (source)

Undocumented

def literal_eval(node): (source)

Modified version of ast3.literal_eval, handling things like typenames.

def _convert(node): (source)

Helper function for literal_eval.

_NUM_TYPES = (source)

Undocumented

Value
(int, float, complex)