I'm working with a code snippet that iterates over an object list and filters out objects to perform a specific task. The for loop consists of multiple nested if statements (and I'll probably add more in the future).
Here's my code:
for obj in objects:
if 'x' not in obj.name:
if 'y' not in obj.name:
if 'z' not in obj.name:
if obj.length > 0:
if obj.is_directory == True:
# Do Something
Is there a neat or efficient workaround for this snippet?
Please Advise