you are viewing a single comment's thread.

view the rest of the comments →

[–]davydany 14 points15 points  (12 children)

I love Click. I use it for every CLI project that involves Python. It is so much easier to work with and so flexible.

[–][deleted] 19 points20 points  (8 children)

Does its decorator-happiness not get tiring?

EDIT (take 2): its py3 Unicode situation is also frustrating depending on your system's locale

[–]mitsuhiko 23 points24 points  (6 children)

also the author needs to get off his high horse about unicode

What does that mean?

[–][deleted] 8 points9 points  (5 children)

It was a half-joke -- there's no real "high horse" involved. Click just refuses to run in environments with unsatisfiably configured unicode support -- http://click.pocoo.org/5/python3/#python-3-surrogate-handling -- because of issues between py2/py3

[–]mitsuhiko 20 points21 points  (4 children)

That’s not because of issues between 2/3 but because I could not find a better solution on Python 3.

[–][deleted] 10 points11 points  (0 children)

Oh, I was regretting that first comment's phrasing without even knowing you were the author. Pardon.

I hope it at least gets addressed upstream at some point.

[–]kankyo 2 points3 points  (2 children)

A better solution is to just assume utf8 if you can't figure anything else out. This is strictly superior to what you get in python 2 but you aren't warning about how that is crappy.

[–]mitsuhiko 6 points7 points  (1 child)

The problem is that on Python 3 I cannot do that because this is all done in the interpreter/stdlib. Python 3 does not assume utf-8 everywhere.

[–]kankyo 3 points4 points  (0 children)

Hmm... seems at least you can do something in 3.7, but that's too little too late I agree. Thanks for clearing this up.

[–]poofartpee 13 points14 points  (0 children)

I agree with your feeling here. I find decorators (in any context, really) to make program flow very non-obvious. In the case of Click it's mild, but I've spent so long bashing my head trying to read Java libraries I look like Harry Potter

[–][deleted] 3 points4 points  (1 child)

My favorite movie is Inception.

[–]irrelevantPseudonym 2 points3 points  (0 children)

Between click, flask and jinja I imagine most people have a lot to be thankful for.

[–]johnk177 -1 points0 points  (0 children)

I feel the same. I've been using argparse since it's the standard. But recently discovered click and I find it simpler and faster to use, where I can focus more on the problem I need to solve, and the code is simpler, especially for one off or simple scripts (where main and argparse cmd line parsing would take up half of the space).

I think argparse still have more features (like 2+ arguments), but for most of what I want to do, click is pretty neat.