SourceDeepTrackNode#

class deeptrack.sources.base.SourceDeepTrackNode(action: Callable[[...], Any] | None = None, **kwargs: Any)#

Bases: DeepTrackNode

A node that creates child nodes when attributes are accessed.

This class is used to create a node that creates child nodes when attributes are accessed. Assumes the value of the node is dict-like (i.e. has a __getitem__ method that takes a string).

Example: >>> node = SourceDeepTrackNode(lambda: {“a”: 1, “b”: 2}) >>> child = node.a >>> child() # returns 1

Parameters#

actioncallable

The action that returns the value of the node.