symforce.values.attr_accessor module

class AttrAccessor(values)[source]

Bases: object

Helper to provide dot access for Values. This is an internal-only class.

Example

>>> x0_dict = v['states.x0']
>>> x0_attr = v.attr.states.x0
>>> assert x0_dict == x0_attr
Parameters:

values (Dict[str, Any]) –

__getattr__(attr)[source]

Access a key with the given path.

Parameters:

attr (str) – Example, ‘states.x0’

Returns:

any

Return type:

Any

__setattr__(attr, value)[source]

Set a key.

Parameters:
  • attr (str) –

  • value (any) –

Return type:

None

__dir__()[source]

Enumerate the contained attributes, for introspection purposes like tab completion.

Returns:

iterable (str)

Return type:

List[str]