René's URL Explorer Experiment
Title: Implement Python 3.15 type alias and variadic metadata by youknowdot · Pull Request #9113 · RustPython/RustPython · GitHub
Open Graph Title: Implement Python 3.15 type alias and variadic metadata by youknowdot · Pull Request #9113 · RustPython/RustPython
X Title: Implement Python 3.15 type alias and variadic metadata by youknowdot · Pull Request #9113 · RustPython/RustPython
Description: Summary
Extract the native typing metadata portion of #8954, against current main, using the Python 3.15.0 final contract at CPython d220409a13b77de7a6c30abe16ea90db01528edc (Objects/typevarobject.c, its generated Clinic header, and relevant upstream test sources).
Add TypeAliasType.__qualname__, optional constructor qualname, qualified repr, and writable/deletable __module__ with lazy-evaluator fallback. Keep __reduce__ based on the unqualified name.
Add raw-identity TypeVarTuple.__bound__ and variance flags. Explicit construction defaults to invariant; compiler-created parameters infer variance.
Preserve surrogate-containing names and string-subclass contents in representations. Validate argument binding/name types before ordered truthiness callbacks and report conflicting variance like final CPython.
Add bounded Python regressions in the existing typing snippet.
Merged ParamSpec behavior from #9071 is unchanged. The follow-up test synchronization copies six complete canonical test definitions from final CPython through scripts/update_lib copy-test, with source/destination SHA256 pins: two methods in Lib/test/test_type_aliases.py and four in Lib/test/test_typing.py. No surrounding tests, markers, imports, or fixtures change; there are no manual assertion edits or new skips. This split does not update Lib/typing.py; compiler PR #9105 is now merged in its base.
The earlier statement that full typing.py migration necessarily needs PEP 810 was too strong: the current parser accepts lazy-import syntax but codegen performs an eager import, and the final typing lazy-import test is CPython-only. A broader library migration is deferred to separate work rather than treated as a proven blocker.
Validation
Passed on Linux with the repository's unmodified release profile:
cargo build --release --locked --no-default-features --features threading,stdlib,stdio,importlib,host_env --bin rustpython -j 1
Both newly added functions, test_type_alias_metadata and test_typevartuple_bound_and_variance, extracted through AST with only the assertion helper definitions and executed independently by the candidate release binary. Each had a 30-second timeout, and the candidate typing.py path was verified.
cargo clippy --release --locked -p rustpython-vm --no-default-features --features compiler,threading,host_env -j 1 -- -D warnings
Normal configured commit hooks (merge-conflict checks, Ruff format/import checks, rustfmt, cspell); unrelated hooks skipped by their configured file scopes.
These are focused checks. The full existing snippet, full pytest/snippet suite, full upstream typing modules, workspace/C-API suites, all-target Clippy, and other platforms were not run. Final CPython was used as a source reference; no CPython 3.15 final executable was available for a runtime oracle comparison.
Canonical test synchronization after CI
The first Ubuntu CI run reported seven failures across six methods because the bundled pre-final tests still expected unqualified alias names and unprefixed explicit TypeVarTuple names. The Rust results match final CPython. Commit 42e62a105 uses the official hash-pinned whole-test copy path for:
TypeParamsAliasValueTest.test_repr and test_recursive_repr
GenericTests.test_repr_3 (two affected subcases)
TypeVarTupleTests.test_cannot_subclass, test_repr_is_correct, and test_variadic_class_alias_repr_is_correct
Independent source review verified byte-identical complete definitions, all intermediate hashes, unchanged surrounding files, and retained case/assertion coverage. All six exact methods passed locally with the preserved candidate release binary, candidate module-path guards, and separate 30-second limits. Normal commit hooks passed. No Rust rebuild was needed; full suites were not rerun locally. New-head hosted CI remains to be evaluated.
AI assistance
OpenAI Codex implemented this split, independently source-reviewed the changes, wrote the regression additions, ran the focused automated checks above, and prepared this PR. The runtime did not expose a model-version identifier. No human manual testing is claimed. Submitted at the maintainer's explicit request under the project's maintainer exemption.
Rebase onto updated dependencies
Rebased without conflicts onto main 016ed92f9ef919125781842537c299fd4bbd250d (including the merged malachite 0.14 update), producing head 4d68c83635431a68f3d9bd9e85b21f59c81be847. Both commits have unchanged patches; all five PR files and six canonical copied definitions remain byte-identical to the previous head. All configured hooks passed after each replayed commit.
The six targeted canonical methods and two bounded snippet functions passed again using the preserved earlier candidate executable with the rebased library paths. No new executable was built locally: these runs do not validate a malachite 0.14 build. New-head hosted CI provides that integration check; no broader tests or new features were added.
Rebase onto the merged compiler update
Rebased onto main 2a09ee02bd16dbe4405e1476efe92f7e59de94f7 (merged compiler PR #9105), producing head 017ec6b1471cd5d434a8e60566ea170da95231c2. Both replayed patches are unchanged according to range-diff, and all five PR files are byte-identical to the prior head. Normal configured hooks passed after each replayed commit.
A fresh release executable was built from this combined head with the release command above, one build job, and incremental compilation disabled. Unlike the earlier preserved-binary checks, these results exercise the merged compiler integration. The two bounded snippet functions and six canonical methods listed above passed again. Four additional existing canonical methods from TypeParamsAliasValueTest also passed: test_alias_value_01, test_alias_value_02, test_alias_value_04, and test_raising.
All 12 checks ran in separate fresh processes with a 30-second timeout and 1 GiB address-space limit, with candidate module paths verified. The ten unittest selections each ran one test with zero skips; both bounded snippet functions completed successfully. The same strict VM Clippy command above passed for this head. The full typing modules, full snippet/pytest suite, workspace/C-API suites, all-target Clippy, and other platforms remain untested locally. Hosted CI for this new head is pending evaluation.
Summary by CodeRabbit
New Features
Type aliases now expose qualified names, with defaults based on whether the alias is created lazily or eagerly. Their module metadata can be updated, and lazy aliases continue to use the evaluator’s module when no module is set.
TypeVarTuple now exposes bound and variance metadata, including covariance, contravariance, and inferred variance. Its representation reflects explicit variance.
Bug Fixes
Invalid type alias and TypeVarTuple constructor arguments are rejected, including incompatible variance options.
Open Graph Description: Summary
Extract the native typing metadata portion of #8954, against current main, using the Python 3.15.0 final contract at CPython d220409a13b77de7a6c30abe16ea90db01528edc (Objects/typevarobject....
X Description: Summary
Extract the native typing metadata portion of #8954, against current main, using the Python 3.15.0 final contract at CPython d220409a13b77de7a6c30abe16ea90db01528edc (Objects/typevarobject....
Opengraph URL: https://github.com/RustPython/RustPython/pull/9113
X: @github
direct link
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cc65c7ee-c767-9890-5651-a1456300c384 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8CB8:3D97C8:34D0BBF:463D401:6B01FE91 |
| html-safe-nonce | 72bca9797081b35848b1200dde0eaa5711fc47390127147bf8306446c7610d70 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0I4OjNEOTdDODozNEQwQkJGOjQ2M0Q0MDE6NkIwMUZFOTEiLCJ2aXNpdG9yX2lkIjoiNjIxMzMxMTI0MDgwMzA1NzI5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3f508781028067ea2bb2b29832a4a95bc8d7eb8d8e3a3dd3403d0a29b2d77cd3 |
| hovercard-subject-tag | pull_request:4856673034 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9113/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary
Extract the native typing metadata portion of #8954, against current main, using the Python 3.15.0 final contract at CPython d220409a13b77de7a6c30abe16ea90db01528edc (Objects/typevarobject.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/RustPython/RustPython/pull/9113/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9113%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9113%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython |
| Reload | https://github.com/RustPython/RustPython/pull/9113/files |
| Reload | https://github.com/RustPython/RustPython/pull/9113/files |
| Reload | https://github.com/RustPython/RustPython/pull/9113/files |
| RustPython | https://github.com/RustPython |
| RustPython | https://github.com/RustPython/RustPython |
| Code | https://github.com/RustPython/RustPython |
| Issues195 (195) | https://github.com/RustPython/RustPython/issues |
| Pull requests133 (133) | https://github.com/RustPython/RustPython/pulls |
| Discussions | https://github.com/RustPython/RustPython/discussions |
| Actions | https://github.com/RustPython/RustPython/actions |
| Projects | https://github.com/RustPython/RustPython/projects |
| Wiki | https://github.com/RustPython/RustPython/wiki |
| Security and quality | https://github.com/RustPython/RustPython/security |
| Insights | https://github.com/RustPython/RustPython/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose |
| youknowone | https://github.com/youknowone |
| RustPython:main | https://github.com/RustPython/RustPython/tree/main |
| youknowdot:typing-315-features | https://github.com/youknowdot/RustPython/tree/typing-315-features |
|
Conversation
6
| https://github.com/RustPython/RustPython/pull/9113 |
|
Commits
2
| https://github.com/RustPython/RustPython/pull/9113/commits |
|
Checks
21
| https://github.com/RustPython/RustPython/pull/9113/checks |
|
Files changed
| https://github.com/RustPython/RustPython/pull/9113/files |
| Please reload this page | https://github.com/RustPython/RustPython/pull/9113/files |
|
Implement Python 3.15 type alias and variadic metadata
| https://github.com/RustPython/RustPython/pull/9113/files#top |
|
Show all changes
2 commits
| https://github.com/RustPython/RustPython/pull/9113/files |
|
8dc8a78
Implement Python 3.15 type alias and variadic metadata
youknowdot Oct 14, 2026
| https://github.com/RustPython/RustPython/pull/9113/commits/8dc8a783944e3c8186967d21d37350bc123b023b |
|
017ec6b
Sync canonical typing repr tests with Python 3.15 final
youknowdot Oct 14, 2026
| https://github.com/RustPython/RustPython/pull/9113/commits/017ec6b1471cd5d434a8e60566ea170da95231c2 |
|
Clear filters
| https://github.com/RustPython/RustPython/pull/9113/files |
| Please reload this page | https://github.com/RustPython/RustPython/pull/9113/files |
| Please reload this page | https://github.com/RustPython/RustPython/pull/9113/files |
|
test_type_aliases.py
| https://github.com/RustPython/RustPython/pull/9113/files#diff-fbb72c37839a4f1c6b2200174b4d12d023e2cdf86e6818332389fcc77daeb487 |
|
test_typing.py
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
_typing.rs
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
typevar.rs
| https://github.com/RustPython/RustPython/pull/9113/files#diff-f7936d794eb55f426d2951988fd6dcb8a34bb47d64db10d45728e0b7077f1de7 |
|
stdlib_typing.py
| https://github.com/RustPython/RustPython/pull/9113/files#diff-3bcd326bf8fcb70e4d274580efdc3081123293489fdf9655353ac35953c689b9 |
| Lib/test/test_type_aliases.py | https://github.com/RustPython/RustPython/pull/9113/files#diff-fbb72c37839a4f1c6b2200174b4d12d023e2cdf86e6818332389fcc77daeb487 |
|
View file
| https://github.com/youknowdot/RustPython/blob/017ec6b1471cd5d434a8e60566ea170da95231c2/Lib/test/test_type_aliases.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/RustPython/RustPython/pull/9113/{{ revealButtonHref }} |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-fbb72c37839a4f1c6b2200174b4d12d023e2cdf86e6818332389fcc77daeb487 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-fbb72c37839a4f1c6b2200174b4d12d023e2cdf86e6818332389fcc77daeb487 |
| Lib/test/test_typing.py | https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
View file
| https://github.com/youknowdot/RustPython/blob/017ec6b1471cd5d434a8e60566ea170da95231c2/Lib/test/test_typing.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/RustPython/RustPython/pull/9113/{{ revealButtonHref }} |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-04d29c98076c2d6bb75921ea9becb26a862544d39b71db87b6e354c759b9305d |
| crates/vm/src/stdlib/_typing.rs | https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
View file
| https://github.com/youknowdot/RustPython/blob/017ec6b1471cd5d434a8e60566ea170da95231c2/crates/vm/src/stdlib/_typing.rs |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/RustPython/RustPython/pull/9113/{{ revealButtonHref }} |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
|
| https://github.com/RustPython/RustPython/pull/9113/files#diff-a93fc0a83c07336a0ee35bf0dd0a022c3eb3b689663e589b8734bc1cc2b8b437 |
| Please reload this page | https://github.com/RustPython/RustPython/pull/9113/files |
| Please reload this page | https://github.com/RustPython/RustPython/pull/9113/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Viewport: width=device-width
URLs of crawlers that visited me.