Skip to content

python

Generated by sema doc from the compiler’s authoritative native-signature registry.

Governed persistent Python worker — bring it in with import python; calls require their declared process effects.

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")

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", [])

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")

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"))

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"))