⚡ Sangsakala Proxy 🏠 Home
Skip to content

Align TypeAliasType constructor binding and validation - #9687

Draft
youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:typealias-constructor-controls-group-20261104
Draft

youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:typealias-constructor-controls-group-20261104

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

  • Replace manual TypeAliasType argument parsing with shared raw FromArgs/bind_for handling.
  • Require native type parameters before evaluating defaults, propagate lazy-default and repr exceptions, and preserve surrogate code points in diagnostics.
  • Normalize empty parameter tuples while retaining original inputs through metadata capture and allocation.
  • Read the caller function's module metadata through existing frame APIs.

Reference: CPython 3.15.0 TypeAliasType construction and type-parameter validation and generated Clinic wrappers.

Validation

  • Independent source review and bounded CPython 3.15 reference probes cover exact parameter types, lazy-default/invalid-repr exceptions, tuple subclasses and lifetimes, None versus omitted arguments, caller metadata, and surrogate diagnostics.
  • Formatting and whitespace checks passed.
  • Normal commit hooks passed.
  • Focused cargo check --locked --offline -j1 -p rustpython-host_env -p rustpython-vm -p rustpython-stdlib --features rustpython-stdlib/threading passed.
  • Strict Clippy with the same packages/features and -- -D warnings passed. This is a focused threading-enabled subset of CI, not the full workspace/all-targets suite.
  • RustPython runtime, full workspace/C-API suites and cross-platform execution were not run. No test, Lib, workflow or marker edits.

Shared-binder mixed-invalid error precedence and wording remain different from Clinic in some combinations. This change adds no bespoke parser or VM frame architecture changes, and is independent of the TypeVar constructor group.

AI assistance: OpenAI Codex performed source comparison, implementation, reference probes and independent source review; model version was not exposed.

Reuse shared raw argument binding, validate native type parameters before
reading defaults, and preserve callback exceptions and WTF-8 diagnostics.
Normalize empty parameter tuples while retaining inputs through allocation,
and derive caller module metadata from the existing function-frame API.

Assisted-by: OpenAI Codex:model version not exposed
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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