Skip to content

Align TypeAliasType constructor binding and validation - #9687

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:typealias-constructor-controls-group-20261104
Nov 5, 2026
Merged

youknowone merged 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

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:typealias-constructor-controls-group-20261104 (c4e720d) with main (7b2dd07)2

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (c992a81) during the generation of this report, so 7b2dd07 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@youknowone
youknowone marked this pull request as ready for review November 5, 2026 02:18
@chatgpt-codex-connector

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 ⚠️ Failed 2026-11-05T02:18:24.283161Z
We couldn’t complete this review. Comment @codex review to try again.
c4e720d Draft marked ready
ℹ️ 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.

@youknowone
youknowone merged commit e606728 into RustPython:main Nov 5, 2026
21 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

2 participants