Hacker News new | past | comments | ask | show | jobs | submit login

I've taken a crack at something similar, I'd love to see what you came up with. I ended up with this super-meh solution: https://github.com/zmap/ztag/blob/master/ztag/transform.py#L...



My thing turned out to be pretty much the same as yours, also equally meh:

https://github.com/skorokithakis/jsane

There's no code there, but the underlying class is pretty much spot on yours. I'm still trying to improve the API, but it's not looking great.


What I had in mind sounds pretty close to yours, really. I was thinking of adding a default somewhere along the line (possibly the end), so you could do:

json.structure.that.i.want.to.access.default(True)

Or something like that. I don't really like the default item API I've come up... I'll comment here if I do give it a go, thanks for the snippet!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: