Skip to content

Reject unknown size and length unit words - #105

Open
ShahadatTest wants to merge 1 commit into
xolox:masterfrom
ShahadatTest:fix/exact-size-units
Open

ShahadatTest wants to merge 1 commit into
xolox:masterfrom
ShahadatTest:fix/exact-size-units

Conversation

@ShahadatTest

Copy link
Copy Markdown

Match complete known size symbols, unit names and single-letter decimal prefixes instead of accepting any word with the same initial. Match complete length symbols and metre names too. Preserve documented bare numbers, case-insensitive symbols and plural units.

Validation: the new regressions reject examples such as 1 taco, 1 banana, 1 moon and 1 cmake, while checking valid decimal/binary and length aliases. Both new tests fail on upstream. All 71 tests pass on Python 3.11.18; flake8 on the changed files passes. The run has the existing pipes deprecation warning. No independent human review is claimed.

Closes #104

AI assistance: OpenAI Codex implemented, inspected and tested this change. No independent human review is claimed.

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.

parse_size() silently accepts any word starting with a unit letter ("1 taco" → 1 TB) instead of raising InvalidSize

1 participant