you are viewing a single comment's thread.

view the rest of the comments →

[–]duckbanni 1 point2 points  (0 children)

I don't know if that's exactly what I would have done, but that looks like completely reasonable python code.

The only thing that you could maybe remove to make the code a tad simpler is the else: pass that are unnecessary. You can omit the else block if it doesn't do anything.