Skip to content
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

Allow is_flag=True, multiple=True with non-bool flag_value #2293

Closed
wants to merge 1 commit into from

Conversation

hashstat
Copy link

Allow creating options with is_flag=True and multiple=True if
flag_value is also set to a non-bool value.

Fixes #2292

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

Copy link

@epruesse epruesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Perhaps add this use case to docs?

CHANGES.rst Show resolved Hide resolved
@hashstat hashstat force-pushed the 2292-fix-multi-value-flags branch from d05e68f to f214fe1 Compare October 27, 2022 15:59
@hashstat hashstat force-pushed the 2292-fix-multi-value-flags branch from f214fe1 to 6931525 Compare January 26, 2023 16:37
@hashstat hashstat requested a review from epruesse January 26, 2023 16:43
wpietri pushed a commit to wpietri/simpleais that referenced this pull request Apr 12, 2023
Allow creating options with is_flag=True and multiple=True if
flag_value is also set to a non-bool value.
@davidism davidism force-pushed the 2292-fix-multi-value-flags branch from 6931525 to b112319 Compare July 1, 2023 19:11
@davidism davidism added this to the 8.1.4 milestone Jul 1, 2023
@davidism davidism linked an issue Jul 1, 2023 that may be closed by this pull request
@davidism
Copy link
Member

davidism commented Jul 3, 2023

Ended up fixing the issue in #2550 instead of raising any error at all.

@davidism davidism closed this Jul 3, 2023
@davidism davidism removed this from the 8.1.4 milestone Jul 3, 2023
@hashstat hashstat deleted the 2292-fix-multi-value-flags branch July 12, 2023 18:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-value flags broken by recent change
3 participants