Link `Module.exec_order` to `Module.children`
Description
Module
is the base class for oriented graphs, used for System
and Driver
.
It possesses an attribute exec_order
used to loop through dictionary children
in a prescribed order.
However, attribute children
is already an ordered collection, so maintaining a separate attribute to specify an order is redundant.
Moreover, having both attributes children
and exec_order
is a possible source of error, and certainly a source of complexity in the code (one has to make sure exec_order
contains all the keys of children
, for example).
Proposal
Make exec_order
a simple property returning the keys of children
in a list.
Reciprocally, setting exec_order
will rearrange children
keys.
Hence, children
and exec_order
will be consistent by construction.
Edited by Etienne Lac