Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the problem that this PR addresses?
Related to #514. Expensive validators can delay typing.
validate_while_typing=Falsealready works through**kwargs, but the option is absent from Questionary's public signatures and parameter documentation.How did you solve it?
Expose
validate_while_typingas a keyword-only parameter on text, password, path and autocomplete prompts, and document how to defer validation until submission. The default remainsTrue. Both booleans and prompt_toolkit filters remain supported, including with prompt_toolkit 2.Add 24 parametrized cases covering the signatures, filter forwarding, rejection of invalid submissions and validation timing during input. The timing tests use real prompt input pipes with dummy output; they are specific to prompt_toolkit 3's asyncio loop. Submission tests cover both supported prompt_toolkit major versions.
Validation on Windows:
--target-version py310), isort 5.12.0, Flake8 7.1.0 andgit diff --checkpassed for the changed files.With mypy 2.4.0 and prompt_toolkit 3.0.53, both the unmodified base and this branch report the same four pre-existing PromptSession formatted-text argument errors. Those are outside this change. Linux and macOS have not been tested locally.
Checklist