SnakeBridge.Dynamic (SnakeBridge v0.7.4)
View SourceDynamic dispatch for calling methods on Python objects without generated code.
Use this module when:
- Python returns an object of a class you did not generate bindings for
- You need to call methods dynamically at runtime
- You want a no-codegen escape hatch for refs
Summary
Functions
Calls a method on a Python object reference.
Gets an attribute from a Python object reference.
Checks if a value is a valid Python reference.
Sets an attribute on a Python object reference.
Types
@type opts() :: keyword()
@type ref() :: SnakeBridge.Ref.t() | map()
Functions
@spec call(ref(), atom() | String.t(), list(), opts()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Calls a method on a Python object reference.
Gets an attribute from a Python object reference.
Checks if a value is a valid Python reference.
@spec set_attr(ref(), atom() | String.t(), term(), opts()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Sets an attribute on a Python object reference.