I want to delete the file filename
if it exists. Is it proper to say
if os.path.exists(filename):
os.remove(filename)
Is
if os.path.exists(filename): os.remove(filename)
is a one-liner.
Many of you may disagree - possibly for reasons like considering the proposed use of ternaries "ugly" - but this begs the question of whether we should listen to people used to ugly standards when they call something non-standard "ugly".