by tremon · 3y ago · 0 comments
try:
my_dict[key]
catch KeyException:
pass
rather than if key in my_dict:
my_dict[key]
is astounding. I don't know what the performance difference is in Python though. thing = my_dict.get(key)
if thing is None:
...Is there an easy way to get bytecode for Python snippets?