AllView#

class blueprints.AllView[source]#

Bases: AllViewType, View

The AllView is analogous to the View for all descendants instead of children. Attribute getting and setting is handeled for all valid descendants. A ThingsType attribute is then converted back to a normal view.

XML Structure:#
<body name="A">
        <body name="B" />
        <geom mass="42.0" type="sphere" name="C" />
</body>
Children and Descendants View Comparison:#
>>> world.bodies
View[1|anonymous_model.bodies]
>>> world.bodies.name
['A']
>>> world.all
View[3|anonymous_model.all]
>>> world.all.name
['A', 'B', 'C']
>>> world.all.bodies
View[2|anonymous_model.all.bodies]
>>> world.bodies.name
['A', 'B']

If only some descendants have a certain attribute, the view restricts to this valid subset. For example, only Geoms have mass, so retrieving all.mass excludes all non-Geoms.

Children and Descendants View Comparison:#
>>> world.all.mass
[42.0]
__init__(descendants, parent)[source]#
Parameters:
  • descendants (dict) – The descendants property invoked on parent

  • parent (blue.ThingType) – The parent Thing from which .all was retrieved.

Return type:

None

classmethod __new__(*args, **kwargs)#