Skip to content

chore(quest): plan python-method-shadow - #799

Merged
kixelated merged 2 commits into
mainfrom
quest/python-method-shadow-plan
Nov 14, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/python-method-shadow-plan

Conversation

@kixelated

@kixelated kixelated commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Adds the follow-up quest python-method-shadow, found while working on #777. This is a separate PR so the quest's decisions don't hold up #777.

In a generated Python binding, a method named after a builtin, such as bytes, hides that builtin in the type annotations of later methods in the same class, and mypy rejects the generated stub. #777 got around it by renaming its fixture's Clash::bytes to raw.

Decisions

Settled by the maintainer in #799 (comment) and recorded in the quest's Plan:

  • ✅ Keep the quest (rejected: drop).
  • ✅ Generated Python refers to a shadowed builtin through an import alias such as _bytes, as _array is imported (rejected: builtins.bytes).

While recording them, I found the module header already imports _bytes, _int, _list and others from builtins for runtime code; only the annotations still use the bare names. The Plan now says so, which keeps the quest at S or smaller.

Validation

Quest-only change: quest check passes. No code or public API changes.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, low effort (iterate, XS, arm B)

(Written by Claude Opus 5.5 with low effort)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: aaf94a4

  • Base: origin/main at da7df3d

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1db5b-0403-7e30-9a66-a3f026a82c90, round 1

  • Score: 10/10, The documentation-only change records the Python builtin-shadowing issue and a proposed fix, with no actionable defects found.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Codex, gpt-6.1-sol, low effort, shadow

  • Session: 01a1db5b-0403-7ca2-8b7c-f0374de4e4e4, round 1

  • Score: 10/10, The change only adds a quest document describing a future Python annotation fix, with no executable code or test changes and no actionable defects.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

Summary by CodeRabbit

  • Documentation
    • Added a quest document outlining Python annotation behavior involving builtin-named methods, along with proposed updates to type annotations and a type-checking fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

A new quest document describes a goal for preventing Python methods named after builtins from shadowing those builtins in later annotations. It outlines proposed aliasing changes and a type-checking fixture check.

Changes: Quest documentation

Layer / File(s) Summary
Goal and proposed changes
quest/m1/ffi-export/python-method-shadow.md
The document describes the goal, proposed builtin type aliases and locked names, a fixture check for a bytes method, rejected alternatives, and maintainer decisions.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to aaf94

This change only adds a planning document for a future Python annotation fix. It does not change generated output or public behavior, so merging it carries no meaningful risk.

Architecture risk: Low · up to aaf94

The change affects 1 system.

Changed systems: quest

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — quest (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in quest/m1/ffi-export/python-method-shadow.md: The new quest document states the goal and outlines the proposed aliasing changes and fixture check; it also records the issue, rejected alternatives, and maintainer decisions.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "chore(quest): plan python-method-shadow" names the change: a quest document is added for the python-method-shadow follow-up. The raw summary and objectives confirm the PR adds only this que…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "chore(quest): plan python-method-shadow" names the change: a quest document is added for the python-method-shadow follow-up. The raw summary and objectives confirm the PR adds only this quest plan, with no code changes. The title states the main change and uses no vague terms. It omits the shadowing problem and the import-alias decision, which is acceptable for a short title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b890bd5f-b8cd-4e23-b320-901f186ba92e
Commits

Reviewing files that changed from the base of the PR and between eeabf32 and aaf94a4.

Files selected for processing: 1

  • quest/m1/ffi-export/python-method-shadow.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (2026-11-14, via /quest-run):

  • ✅ Keep the python-method-shadow quest (rejected: drop).
  • ✅ Generated Python refers to a shadowed builtin through an import alias such as _bytes, as _array is imported (rejected: builtins.bytes).
  • ✅ /quest-merge pick (rejected: skip, /quest-delete).

(Written by Claude Opus 5.5 with high effort)

@kixelated
kixelated marked this pull request as ready for review November 14, 2026 18:39

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes: the one new quest file.

  • python-method-shadow.md: plans the fix for builtin-named methods shadowing builtins in Python annotations. It records the maintainer's decisions to keep the quest and to use an import alias. I checked the plan's claim against ffi/src/python.rs, which already imports _bytes and _array.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 57c03ab Nov 14, 2026
10 checks passed
@kixelated
kixelated deleted the quest/python-method-shadow-plan branch November 14, 2026 18:59
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