nv_dfm_core.api.Block#

class nv_dfm_core.api.Block(*, dfm_body=[])[source]#

A Block is a linear list of Statements (and subclasses of Statements). A Statement must only reference other Expressions (and subclasses of Expression) that come earlier in the block, or possibly earlier in the block containing the statement that contains this block. I.e. you can only reference values that have been defined before.

Parameters:

dfm_body (list[Statement])

add_to_body(stmt)[source]#

Adds statement to the body. Called by Statement post init when pydantic model has been created

Parameters:

stmt (Statement)

model_config: ConfigDict = {'extra': 'forbid', 'frozen': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].