create_or_append_set_transaction#

create_or_append_set_transaction(nodetree) Generator[None, None, None][source]#

Context manager for a transactional set.

In contrast to the set_transaction from the nodetree this function only creates a new transaction if no other is in progress. Should only be called withing the toolkit code.

Warning

This function will silently fail if the existing transaction is exited before this function finishes.

Warning

The set is always performed as deep set if called on device nodes.

Examples

>>> with nodetree.set_transaction():
        nodetree.test[0].a(1)
        with create_or_append_set_transaction(nodetree):
            nodetree.test[1].a(2)
        nodetree.test[2].a(2)
Return type:

Generator[None, None, None]