Click: Using inspect and type annotations [New Feature]

Created on 18 Jan 2020  路  2Comments  路  Source: pallets/click

Hi -- this project looks like what I've been trying to find for a while.

One suggestion: rather than using decorators to specify arguments, consider using Python 3 type annotations and inspect.getfullargspec to get the argument names, types, and default values. You can then more succinctly describe a click command.

Most helpful comment

Check out https://github.com/tiangolo/typer - which is built on top of Click.

All 2 comments

Thanks for the suggestion. We don't plan to add or use annotations at this time. That would be a pretty large departure from the existing API, or would require way more supporting code to maintain both simultaneously. Perhaps an extension could do this.

Check out https://github.com/tiangolo/typer - which is built on top of Click.

Was this page helpful?
0 / 5 - 0 ratings