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]) –

__init__(values)[source]

Construct by saving given values.

Parameters:

values (Values) –

__getattr__(attr)[source]

Access a key with the given path.

Parameters:

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

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.

Return type:

iterable(str)