Y
Hacker News
new
|
ask
|
show
|
jobs
by
taway1237
1023 days ago
This also won't work since it'll crash on missing fields. e.get("commit", {}).get("author", "") maybe (ignoring the corner case of non-list top level object).
1 comments
Perepiska
1022 days ago
Which is pretty useful - I will get malformed JSON error as earlier as possible.
P.S. `some.get("A", {})["B"]` is bad programming habit because there might be a list on `some["A"]`
link
P.S. `some.get("A", {})["B"]` is bad programming habit because there might be a list on `some["A"]`