Skip to content

Add warning callout re: bool and store_true defaults #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2025
Merged

Conversation

johnowhitaker
Copy link
Contributor

Using bool arg with default True results in the default getting over-written (see e.g. #533) which has confused a few people. This PR adds a small warning to the docs to use bool_arg instead.

@johnowhitaker
Copy link
Contributor Author

@jph00 it's a small thing but I've made this mistake in the past (setting my_param:bool=True not realizing it will still default to False). This PR adds a small callout to the docs with a warning to use bool_arg instead of bool in this case.
Demo of what I'm talking about: https://gist.github.com/johnowhitaker/52ae8cbeddaf43a62d345253f515ac97

@jph00 jph00 merged commit 6c4c2f5 into main Mar 31, 2025
14 checks passed
@jph00
Copy link
Contributor

jph00 commented Mar 31, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants