Parsing boolean values with argparse
I think a more canonical way to do this is via: and argparse supports this version nicely: Of course, if you really want the –arg <True|False> version, you could pass ast.literal_eval as the “type”, or a user defined function …