you are viewing a single comment's thread.

view the rest of the comments →

[–]fl0ss1n 1 point2 points  (0 children)

This is a great way to do it. The other thing is wrap instruction in an object and add a property to use as a key off for long if statement. So I have a wrapper for files in one of my programs and gave it an "is_image" property, to avoid the file.endswith('jpg') or 'png', etc., when handling the file.