Ask coding questions

← Back to all posts
Pythonic or PEP 8 compliant
19ecal (228)

I'm making a command line thing
But that is not what I'm asking about
Do I go pythonic

srcpath=os.path.normpath(os.path.expanduser(args.src)) if args.src else DEFAULT_SRC_PATH

or pep 8 compliant (first one is 88 chars long)

if args.src:
    srcpath=os.path.normpath(os.path.expanduser(args.src))
else:
    srcpath=DEFAULT_SRC_PATH