Allow Deque.maxlen to return to an unlimited length - #369
Open
oyeong011 wants to merge 1 commit into
Open
Conversation
Constraint: Preserve existing supported Python syntax and public API behavior. Confidence: high Scope-risk: narrow Tested: 180 core and persistent tests passed; real database reopen and bounded/unbounded transitions Not-tested: Other Python versions and operating systems.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Deque constructors normalize maxlen=None to infinity, but assigning the same value to the public property raises TypeError and leaves the deque unusable for appends. Apply the existing normalization in the setter and document how to remove a limit. The regression uses a real cache with explicit cleanup.
Validation: Original regression raised TypeError at len(cache) > None (diskcache-red.log). 180 tests passed across test_deque.py, test_core.py, test_index.py, test_fanout.py, test_recipes.py (diskcache-green.log).
Manual QA: PASS: remove deque limit, append both ends, reopen real database, restore bounded limit
Limitations: macOS CPython 3.14.6. Django integration, coverage threshold and other interpreter/OS matrices were not run; persistence/core suites were run. Existing negative/noninteger maxlen behavior is outside this fix.
AI disclosure: OpenAI Codex generated and locally tested this patch and regression tests.