I'm new to python and haven't yet read a lot of code to verify which styles are considered 'pythonic'.
As I've started to code, I've been using this pattern alot.
listThatMightBeEmpty = []
for items in listThatMightBeEmpty:
print "this may or may not print but the loop won't cause any errors"
I assume that it would be redundant to first check if the list is empty - that I can just let the for-in loop do nothing if the list is empty. But I want to make sure there aren't any gotchas for any situation including using old versions of python, and including using a for-in loop on dictionaries, using enumerate(), or iteritems(), or using list comprehensions etc.