CONVERSION REFERENCE
Annotations are conversion requirements. They establish representations and proof obligations; they are not treated as optional runtime hints.
| Python annotation or value | C representation | Boundary |
|---|---|---|
bool | bool | Exact Boolean representation; not interchangeable with int. |
int | int64_t | Signed 64-bit proved domain. Admitted literals must fit that domain. |
float | double | Finite floating literals and compatible floating expressions only. |
str | const char *, or owned char * for file reads | UTF-8, NUL, lifetime, and file-session contracts apply. General Python string behavior is not provided. |
No implicit integer-to-floating or floating-to-integer conversion is inserted. Representation changes must be explicitly admitted by the active contract; unsupported coercion rejects.
Supported functions are synchronous, top-level, explicitly annotated, and return a compatible value on every reachable path.
def scale(value: float, factor: float) -> float:
return value * factor
Rejected function forms include:
async def, generators, decorators,
generic functions, and dynamic callable values;None fallthrough, inconsistent return
representations, and a bare return for a non-None signature;The active profile admits exact single-name local assignment, explicit
return, supported conditional and loop forms, break,
continue, supported file with statements, and
understood direct-call expression statements. Unsupported statement kinds
reject the unit.
+ and - on compatible numeric values, and
not where truth representation is proved.+, -, and * for compatible
stable representations./ only for floating-represented operands.and/or and chained comparisons in
admitted conditional regions. Operands are staged to preserve Python
evaluation order and single evaluation.String concatenation, arbitrary method calls, general truthiness, unsupported operator overloading, non-finite floating literals, and representation guessing reject.
// and % use Python floor and remainder semantics
through registered helpers, but only when analysis proves an integer operation
with a safe direct signed-integer literal divisor. The divisor must be nonzero
and must not create the INT64_MIN / -1 overflow case.
def bucket(value: int) -> int:
return value // 10
def signed_remainder(value: int) -> int:
return value % -3
Rejected divisors include zero, Boolean, floating, dynamic,
calculated or folded expressions, -1 where the dividend may be
INT64_MIN, INT64_MIN itself, and out-of-range
integer literals.
Lowering preserves the admitted Python evaluation order and evaluates a staged operand exactly once. A successful source bundle and identical conversion identities produce deterministic generated C. This promise does not extend Python semantics beyond the explicitly supported subset.