Skip to content

Honor an explicit zero maximum in SomeOf - #557

Open
xiehuanyi wants to merge 1 commit into
alecthomas:masterfrom
xiehuanyi:fix/voluptuous-zero-max
Open

xiehuanyi wants to merge 1 commit into
alecthomas:masterfrom
xiehuanyi:fix/voluptuous-zero-max

Conversation

@xiehuanyi

Copy link
Copy Markdown

SomeOf(validators=[int, str], max_valid=0) currently accepts integers and strings: the explicit zero is replaced with the number of validators. This prevents expressing that no sub-validator may pass.

Default min_valid and max_valid only when they are None, preserving explicit zero bounds. Add regression coverage for direct calls and Schema-wrapped validation, including a zero minimum and maximum together.

Validation: both new direct-call regressions fail on unchanged master; the complete test suite passes after the fix (184 tests). Flake8 with doctests and Black checks pass.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@xiehuanyi
xiehuanyi force-pushed the fix/voluptuous-zero-max branch from d6928bc to bc32bb5 Compare October 10, 2026 11:30

This branch has not been deployed

No deployments
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