# utils

URL: /kida/api/compiler/utils/
Section: compiler
Description: Compiler utilities for Kida.

Provides operator mapping utilities for AST generation. These are
module-level functions, not mixin methods — call sites import them
directly.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/compiler/utils/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fcompiler%2Futils%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fcompiler%2Futils%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fcompiler%2Futils%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fcompiler%2Futils%2Findex.txt)

Module

#
`compiler.utils`

Compiler utilities for Kida.

Provides operator mapping utilities for AST generation. These are
module-level functions, not mixin methods — call sites import them
directly.

3Functions

## Functions

`get_binop`

1

`ast.operator`

▼

Map binary operator string to AST operator. Raises KeyError on unknown.

`def get_binop(op: str) -> ast.operator`

##### Parameters

Name
Type
Description

`op`
`str`

##### Returns

`ast.operator`

`get_unaryop`

1

`ast.unaryop`

▼

Map unary operator string to AST operator. Raises KeyError on unknown.

`def get_unaryop(op: str) -> ast.unaryop`

##### Parameters

Name
Type
Description

`op`
`str`

##### Returns

`ast.unaryop`

`get_cmpop`

1

`ast.cmpop`

▼

Map comparison operator string to AST operator. Raises KeyError on unknown.

`def get_cmpop(op: str) -> ast.cmpop`

##### Parameters

Name
Type
Description

`op`
`str`

##### Returns

`ast.cmpop`
