Reputation: 3
Right now I have the following code in my project:
if keyword in sample_namespace:
return sample_namespace[keyword]
else:
return None
Namespace is build dynamically from plugins content.
If it were an dictionary, and not a namespace, I could simply do sample_dict.get(keyword), to get the same functionality. Is there any way how to do this with namespaces while achieving the same neatness?
Upvotes: 0
Views: 131