Skip to content

Allow partial method descriptor access through classes - #686

Open
Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/partial-class-access
Open

Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/partial-class-access

Conversation

@Gambit-Checkmate

@Gambit-Checkmate Gambit-Checkmate commented Oct 30, 2026 •

Copy link
Copy Markdown

The change

Closes #684.

Return InstancePartial/CachedInstancePartial themselves when get receives obj=None for class access. Both currently try MethodType(self, None), which raises TypeError instead of exposing the callable descriptor. Instance access retains its existing binding and caching behavior.

Four new cases fail on unchanged d31d821 and pass with the fix. They cover direct/inherited class access for both variants, descriptor identity, explicit-instance calls through the class, bound calls and cached bound-method identity. Positional prebinding semantics are unchanged.

Validation on Windows / CPython 3.13.13:

  • Full tests and module doctests: 778 passed, 1 skipped, 22 subtests passed.
  • Ruff E9/F on changed source/test, new-test format, compileall and git diff checks passed.
  • Wheel and sdist builds passed. Other platforms/interpreters await hosted CI; no coverage percentage claimed.
  • Unreleased changelog updated; no version bump.

The backstory

My earlier #601 was acknowledged and incorporated in #609. Inspecting the refreshed utility APIs and testing their documented use exposed this issue. This was code inspection with executable regressions, not a claim of personal production usage. Existing issues and open/closed PRs were checked before filing the linked report.

AI assistance

  • Harness/tooling: OpenAI Codex, Git, GitHub CLI/API, Python, pytest and Ruff. Codex performed investigation, implementation, testing and submission.
  • Model(s): GPT-6 family; the exact deployment identifier is not exposed in this session.
  • Original prompt(s), relevant verbatim excerpts from the daily automation (the mailbox workflow and local memory path are omitted):

每天早上 8 点在本会话实际提交两个高质量的开源贡献 PR,把创建并获得 GitHub PR 链接作为每日完成目标。首批候选不合适时必须继续扩大仓库与问题搜索范围,不因候选重复、单个问题困难或尚未发现合适 issue 就结束;没有合适公开 issue 时可以检查代码、复现真实缺陷,确认无重复后报告问题并提交独立修复。

只有改动真实、有依据、验证充分且账号有权限时才推送分支并创建 PR;绝不降低 star 门槛,不提交空改动、无关改动、未经验证或重复 PR,尊重上游 AI 贡献和认领规则。

Hosted CI: Actions run40977414531 is action_required for external-contribution approval; no hosted tests have executed for this head.

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.

Partial method descriptors raise on class access

1 participant