trogon icon indicating copy to clipboard operation
trogon copied to clipboard

Nicer handling of callable defaults

Open chrisjsewell opened this issue 1 year ago • 1 comments

Currently, if you have an option that sets a callable default, it will simply show the str format of it, e.g. if you have:

def my_default():
    return "hi"

@click.command()
@click.option('-o', default=my_default)
def command(option): ...

it will show as <function my_default at 0x10f0fb040>

Obviously, it would be nice if there was a better representation thanks (or just no default was shown)

chrisjsewell avatar Jul 04 '23 03:07 chrisjsewell