Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
new_user_final
1y ago
0 comments
Share
As I have pointed in in my other comment, you can use following syntax in python, ugly but better than multiple and (I don't use python anymore)
if dict.get('key', {}).get('key-nested',{}).get....:
0 comments
default
newest
oldest
jon_richards
1y ago
Even less pretty for getattr. And then you have a rude awakening about the difference between the missing default behavior of these two functions.
j
/
k
navigate · click thread line to collapse