DictReadOnly#

class omni.kit.menu.core.core.DictReadOnly(data)#

Bases: Mapping

Read-only dictionary. Prevents accidental write-backs to dictionary.

Parameters:

data (dict) – The dictionary to be wrapped in a read-only interface.

Methods

__init__(data)

Initializes the DictReadOnly instance.

copy()

Creates a shallow copy of the read-only dictionary.

merge_dict(other)

Merges another dictionary into the current read-only dictionary.

__init__(data)#

Initializes the DictReadOnly instance.

copy()#

Creates a shallow copy of the read-only dictionary.

Returns:

A new DictReadOnly instance with copied data.

Return type:

DictReadOnly

merge_dict(other)#

Merges another dictionary into the current read-only dictionary.

Parameters:

other (dict) – The dictionary to merge with the current dictionary.

Returns:

A new DictReadOnly instance with merged data.

Return type:

DictReadOnly