saealib.registry.to_spec#

saealib.registry.to_spec(obj)[ソース]#

Recursively serialize obj into a spec (the reverse of build()).

Primitives, None, lists/tuples, and dicts pass through structurally (numpy arrays become lists). Functions/builtins become a {"callable": "dotted.path"} marker. Other objects are reflected via their constructor signature: for each __init__ parameter, the same-named attribute on obj is read and serialized recursively. A single *args (VAR_POSITIONAL) parameter is serialized as a params list instead of a dict, so it round-trips through build()'s positional-call path.

パラメータ:

obj (Any)

戻り値の型:

Any