Earlier quoted context omitted.
I can't stand argparse. It's like they tried their hardest to force you to be imperative and prevent composability. For example, instead of being able to define a parser for a subcommand and build a top-lever parser from that, you need to do this: parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() a = subparsers.add_parser('a') a.add_argument('bar') A better API would look more like this: Parser(…
Python is indeed an imperative language, along with the others I listed. (Your proposal would indeed be at home in a functional language like LISP.) But I reject the idea that imperative is bad. You can compose imperative programming fine. def my_parser(parser): parser.add_argument('bar') parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() my_parser(subparsers.add_parser('a')) my_parser(subparsers…
JavaScript has functional origins, and in practice quite a bit of JavaScript is written in a functional-lite style. As a JS developer, I find it quite infuriating that Python doesn't support these patterns, as they make code a lot more readable, and it seems to be a matter of principle rather than a technical limitation.