Apr 19, 2022
I appreciate your point of view of cases with expected and unexpected missing keys but in the case of missing keys being part of normal cases, I suggest going with the defaultdict method mentioned in Point 15. Using try-except may not be a bad practice but I consider it as a less preferable when it comes to handling a large dict or large set of missing keys. I can however see your point of not considering it as a bad practice and will definitely update the post. Thanks for sharing !