r/Python • • Mar 21 '18

Please don’t use Click

http://xion.io/post/programming/python-dont-use-click.html
0 Upvotes

7 comments sorted by

View all comments

6

u/DanCardin Mar 21 '18 edited Mar 21 '18

I feel like a better criticism is that the decorators return a callable which does not act like the function being decorated. This makes testing and composing functions seemingly obnoxious.

I feel like my ideal interface would leverage type annotations and separate there cli registration from definition, maybe something like

def command(name: int, fun: Optional[bool]=None):
    ...

cli.run(
    commands=[command],
)

Edit: I may mean hug

3

u/metaperl Mar 21 '18

That is an impressive library.