Generated by
sema docfrom the compiler’s authoritative native-signature registry.
python (native adapter)
Section titled “python (native adapter)”Governed persistent Python worker — bring it in with import python; calls require their declared process effects.
interop
Section titled “interop”python.import(module) -> any
Section titled “python.import(module) -> any”Import a Python module through the governed persistent worker and return an authenticated immutable object handle.
- domain: one nonempty dotted ASCII module name, at most 512 UTF-8 bytes
- shape: scalar
- returns:
any - effects:
ffi.call - example:
python.import("builtins")
python.call(module, member, args) -> any
Section titled “python.call(module, member, args) -> any”Call one Python module member with explicit positional arguments and forwarded unique keyword arguments.
- domain: bounded dotted ASCII module, one ASCII member, explicit positional-argument list, and unique forwarded keywords
- shape: scalar
- returns:
any - keywords: any unique names
- effects:
ffi.call - example:
python.call("builtins", "len", [[1, 2]])
python.method(object, member, args) -> any
Section titled “python.method(object, member, args) -> any”Resolve and call one exact member on an authenticated Python object handle.
- domain: authenticated Python handle, one ASCII member, explicit positional-argument list, and unique forwarded keywords
- shape: scalar
- returns:
any - keywords: any unique names
- effects:
ffi.call - example:
python.method(python.import("builtins"), "dict", [])
python.attr(object, member) -> any
Section titled “python.attr(object, member) -> any”Resolve one exact member on an authenticated Python object handle.
- domain: authenticated Python handle and one ASCII member at most 256 UTF-8 bytes
- shape: scalar
- returns:
any - effects:
ffi.call - example:
python.attr(python.import("builtins"), "len")
python.str(object) -> str
Section titled “python.str(object) -> str”Return Python’s bounded string representation of an authenticated handle.
- domain: authenticated Python object handle
- shape: scalar
- returns:
str - effects:
ffi.call - example:
python.str(python.import("builtins"))
python.free(object) -> any
Section titled “python.free(object) -> any”Release an authenticated Python object handle and propagate worker failures.
- domain: authenticated Python object handle
- shape: scalar
- returns:
any - effects:
ffi.call - example:
python.free(python.import("builtins"))