pyhcl icon indicating copy to clipboard operation
pyhcl copied to clipboard

Add option to have OrderedDict hooked on load(s)

Open robcxyz opened this issue 5 years ago • 2 comments

Just like the standard libraries json.load(), this is an option to have the result returned in a OrderedDict. Didn't implement it to the t like json.load() but close enough and good enough for my use.

robcxyz avatar Apr 24 '19 05:04 robcxyz

Does this work for nested structures? Would be good to update the test for that.

virtuald avatar Apr 26 '19 05:04 virtuald

This was a super quick hack for me to get order when I was printing my dicts but since I have found a workaround and noticed the whole discussion around json2hcl which I am thinking about wrapping for my use case. I'll let you know if I get motivated to work on #41 alongside this as with hcl2 coming soon, I don't think anyone is going to be interested in maintaining the parser with that addition.

Agreed?

robcxyz avatar Apr 30 '19 23:04 robcxyz