Which method or checking conditions is more suggested to use:
import os
# method 1
if not os.path.exists("somedir"):
os.makedirs("somedir")
# method 2
try:
assert not os.path.exists("somedir")
except AssertionError:
pass
else:
os.makedirs("somedir")
# method 3
try:
os.makedirs("somedir")
except OSError:
pass
Would method 3 still break The Zen of Python ("Errors should never pass silently." if there was some logging?