I suspect theres a better way of doing things, but consider the following code:
opinions?
here is a link to a full example:
https://github.com/rexlx/ternary_fallthr...example.py
def get_args(): if len(sys.argv) > 1: val = int(sys.argv[1]) if int(sys.argv[1]) else fallthrough else: print("expected a number as an arg")[/font]It's almost like a try block but I feel like it reads better...
opinions?
here is a link to a full example:
https://github.com/rexlx/ternary_fallthr...example.py