Replies: 1 comment 1 reply
-
Hey, I hope it's not that late... I've started to use Typer recently and encountered the same issue. I have a fix for your issue. Instead of using def create_user(a_boolean: Annotated[bool,
typer.Option(
help="Help string stufff ....",
)] = False): THe code works with the fix. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Hi, running the above script raises
AttributeError: 'bool' object has no attribute 'isidentifier'
This is caused by the
default=False
option in the Option.I use click 8.1.7, and this one works fine:
Also, when I set the default value directly as a default argument it does works :
The docs says that default is supported, but it seems to works with strings, but not with bool.
Operating System
Linux
Operating System Details
Debian Bookworm
Typer Version
0.12.3
Python Version
3.11.2
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions