So, last week I was working on an armi ticket, and came up with a real need to hide data inside a yamlize.object, that wouldn't be written out to the final YAML. This should have been a small tweak, but ended up being rather hard to trick yamlize to do.
The solutions we came up with were:
- Add an Attribute to the
yamlize.object and delete it right before we .dump().
- Add a hidden class attribute and use Python
hasattr to look for it.
So, we had a solution eventually, but we lost a lot of time on it. What would have really helped would be if Yamlize:
- Offered a way to make an Attribute "hidden", meaning it would never get written to a YAML.
- Offered a way to subclass Attribute, and have that subclass be used throughout the YAML file.
I suppose (1) above would be easier, but (2) would provide a lot more flexibility in the future.
I'd be happy to help implement a solution, if you that's amenable to you.
So, last week I was working on an armi ticket, and came up with a real need to hide data inside a
yamlize.object, that wouldn't be written out to the final YAML. This should have been a small tweak, but ended up being rather hard to trickyamlizeto do.The solutions we came up with were:
yamlize.objectand delete it right before we.dump().hasattrto look for it.So, we had a solution eventually, but we lost a lot of time on it. What would have really helped would be if Yamlize:
I suppose (1) above would be easier, but (2) would provide a lot more flexibility in the future.
I'd be happy to help implement a solution, if you that's amenable to you.