colour.utilities.Structure#

class colour.utilities.Structure(*args: Any, **kwargs: Any)[source]#

Bases: dict

Define a dict-like object allowing to access key values using dot syntax.

Parameters:
  • args (Any) – Arguments.

  • kwargs (Any) – Key / value pairs.

Methods

References

[]

Examples

>>> person = Structure(first_name='John', last_name='Doe', gender='male')
>>> person.first_name
'John'
>>> sorted(person.keys())
['first_name', 'gender', 'last_name']
>>> person['gender']
'male'
__init__(*args: Any, **kwargs: Any)[source]#
Parameters:
  • args (Any) –

  • kwargs (Any) –

__setattr__(name: str, value: Any)[source]#

Assign given value to the attribute with given name.

Parameters:
  • name (str) – Name of the attribute to assign the value to.

  • value (Any) – Value to assign to the attribute.

__delattr__(name: str)[source]#

Delete the attribute with given name.

Parameters:

name (str) – Name of the attribute to delete.

__dir__() Iterable[source]#

Return a list of valid attributes for the dict-like object.

Returns:

List of valid attributes for the dict-like object.

Return type:

list

__getattr__(name: str) Any[source]#

Return the value from the attribute with given name.

Parameters:

name (str) – Name of the attribute to get the value from.

Return type:

object

Raises:

AttributeError – If the attribute is not defined.

__setstate__(state)[source]#

Set the object state when unpickling.

__weakref__#

list of weak references to the object (if defined)