| ▲ | sirsinsalot 5 hours ago | |
Or you know, test if the key exists before using it. The key could exist and be None, representing a legitimate None at that key. Or the key might not exist and asking for it is a bug. Use a defaultdict if you must have all keys optional. Using get() everywhere is buggy because it masks illegal key use. | ||