How to get default value from multidimensional dictionary #10885
vladimirs-git
started this conversation in
General
Replies: 2 comments 2 replies
-
Oops sorry I thought you had pynetbox objects, my bad. This works for you:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank You markkuleinio! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For example, I'm processing Netbox objects, where some items have a reference to the site object and some don't.
In the case when I'm tying to get data from an object without a site, I raise TypeError, but I want to get an empty string.
What is the most elegant way to do this? My target to write simpler code without multiple data types checking.
Beta Was this translation helpful? Give feedback.
All reactions