Module the_dictionary_partial

class ooodev.utils.partial.the_dictionary_partial.TheDict(values=None)[source]

A partial class for implementing dictionary values

Parameters:

values (Dict[str, Any] | None) –

__init__(values=None)[source]
Parameters:

values (Dict[str, Any] | None) –

Return type:

None

get(key, default=<object object>)[source]

Gets user data from event.

Parameters:
  • key (str) – Key used to store data

  • default (Any, optional) – Default value to return if key is not found.

Returns:

Data for key if found; Otherwise, if default is set then default.

Return type:

Any

has(key)[source]

Gets if a key exist in the instance

Parameters:

key (str) – key

Returns:

True if key exist; Otherwise False

Return type:

bool

remove(key)[source]

Removes key value pair from instance

Parameters:

key (str) – key

Returns:

True if key was found and removed; Otherwise, False

Return type:

bool

set(key, value, allow_overwrite=True)[source]

Sets a key value pair for event instance.

Parameters:
  • key (str) – Key

  • value (Any) – Value

  • allow_overwrite (bool, optional) – If True and a key already exist then its value will be over written; Otherwise value will not be over written. Defaults to True.

Returns:

True if values is written; Otherwise, False

Return type:

bool

class ooodev.utils.partial.the_dictionary_partial.TheDictionaryPartial(values=None)[source]

A partial class for implementing dictionary values

Parameters:

values (Dict[str, Any] | None) –

__init__(values=None)[source]

Constructor

Parameters:

values (Dict[str, Any] | None, optional) – Dictionary Values. Defaults to None.

Return type:

None

property extra_data: TheDict

Extra Data Key Value Pair Dictionary

Return type:

TheDict