Hacker News new | ask | show | jobs
by the_mitsuhiko 4433 days ago
Click can be extended lazily which helps execution time a lot when working with many, many plugins. It also can be extended at runtime as per configuraton.

argparse requires the parser to have full knowledge of everything which makes it slow if you add many commands. Biggest problem though is that it's parsing system is a bit broken when it comes to escaping. Options with arguments cannot have values starting with dashes which is problematic for delegating subcommands to other things.

For what I wrote Click for I could not find any alternatives that worked that way besides optparse itself but that is hard to use.

1 comments

Can you provide an example of what you're saying? I've found that argparse.ArgumentParser.parse_known_args() and sub-parsers can do everything I can see click doing. Including lazy loading of plugins and the like.
Argparse has too magic of a design that you could fully nest it. I tried it many times but you always run into it's limitations.

Links to some open bugs on it:

  * http://bugs.python.org/issue13966
  * http://bugs.python.org/issue14191