Skip to content

Allow Deque.maxlen to return to an unlimited length - #369

Open
oyeong011 wants to merge 1 commit into
grantjenks:masterfrom
oyeong011:fix/deque-unlimited-maxlen
Open

Allow Deque.maxlen to return to an unlimited length#369
oyeong011 wants to merge 1 commit into
grantjenks:masterfrom
oyeong011:fix/deque-unlimited-maxlen

Conversation

@oyeong011

Copy link
Copy Markdown

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.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T03:08:47.560847Z 616ccb5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant