src/basilisp/lang/compiler/generator.py
def _interop_call_to_py_ast(ctx: GeneratorContext, node: HostCall) -> GeneratedPyAST:
    """Generate a Python AST node for Python interop method calls."""
    assert node.op == NodeOp.HOST_CALL

    target_ast = gen_py_ast(ctx, node.target)
    args_deps, args_nodes = _collection_ast(ctx, node.args)

    return GeneratedPyAST(
        node=ast.Call(
            func=ast.Attribute(
                value=target_ast.node,
                attr=munge(node.method, allow_builtins=True),
                ctx=ast.Load(),
            ),
            args=list(args_nodes),
            keywords=[],
        ),
        dependencies=list(chain(target_ast.dependencies, args_deps)),
    )
def _interop_call_to_py_ast(ctx: GeneratorContext, node: HostCall) -> GeneratedPyAST:
    """Generate a Python AST node for Python interop method calls."""
    assert node.op == NodeOp.HOST_CALL

    target_ast = gen_py_ast(ctx, node.target)
    args_deps, args_nodes = _collection_ast(ctx, node.args)

    return GeneratedPyAST(
        node=ast.Call(
            func=ast.Attribute(
                value=target_ast.node,
                attr=munge(node.method, allow_builtins=True),
                ctx=ast.Load(),
            ),
            args=list(args_nodes),
            keywords=[],
        ),
        dependencies=list(chain(target_ast.dependencies, args_deps)),
    )
def _interop_call_to_py_ast ( ctx : GeneratorContext , node : HostCall ) -> GeneratedPyAST : assert node . op == NodeOp . HOST_CALL target_ast = gen_py_ast ( ctx , node . target ) args_deps , args_nodes = _collection_ast ( ctx , node . args ) return GeneratedPyAST ( node = ast . Call ( func = ast . Attribute ( value = target_ast . node , attr = munge ( node . method , allow_builtins = True ) , ctx = ast . Load ( ) , ) , args = list ( args_nodes ) , keywords = [ ] , ) , dependencies = list ( chain ( target_ast . dependencies , args_deps ) ) , )
Generate a Python AST node for Python interop method calls.
Generate a Python AST node for Python interop method calls .