-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Description
Currently calling ec.copy() (as done e.g. by the Bundle and Extension easyblocks) involves calling the "default" __init__ function which does another parse call.
This will also call the parse hook which might lead to unexpected results.
In general it is unnecessarily slow.
In general we want newec.attr = deepcopy(self.attr) for each attr in the easyconfig. That could be a manual list risking it goes out of sync with those set in the __init__ call or iterate over dir(self) to get everything
2 approaches:
- Do a deep copy of the full contents of the easyconfig instance, this could require some customization via
__deep_copy__but should be the most complete. In the endec.copy()callers might reasonably expect to get an exact copy of the current state of the easyconfig. - Store the name of the attributes set at the end of the EasyConfig
__init__call. In thecopymethod iterate over those and do a deepcopy of their current values
Metadata
Metadata
Assignees
Labels
No labels