René's URL Explorer Experiment


Title: (3.14) Templates not typeable without TypeVarTuple transformations · Issue #14878 · python/typeshed · GitHub

Open Graph Title: (3.14) Templates not typeable without TypeVarTuple transformations · Issue #14878 · python/typeshed

X Title: (3.14) Templates not typeable without TypeVarTuple transformations · Issue #14878 · python/typeshed

Description: I recently tried to create my own stubs for Python 3.14's Template and Interpolation types, but it seems that is currently not possible. I waited a while and searched a lot and did not find anybody talk about this issue anywhere. Their r...

Open Graph Description: I recently tried to create my own stubs for Python 3.14's Template and Interpolation types, but it seems that is currently not possible. I waited a while and searched a lot and did not find anybody...

X Description: I recently tried to create my own stubs for Python 3.14's Template and Interpolation types, but it seems that is currently not possible. I waited a while and searched a lot and did not find any...

Opengraph URL: https://github.com/python/typeshed/issues/14878

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"(3.14) Templates not typeable without TypeVarTuple transformations","articleBody":"I recently tried to create my own stubs for Python 3.14's `Template` and `Interpolation` types, but it seems that is currently not possible. I waited a while and searched a lot and did not find anybody talk about this issue anywhere.\n\nTheir runtime generic-ness was recently added:\nhttps://github.com/python/cpython/issues/133970\n\nBut it seems that it is not currently possible to actually type hint them correctly within the current typing spec, because transformations of the `TypeVarTuple` would be necessary. (https://github.com/python/typing/issues/1216)\n\nCurrently the code for those two classes' typing stubs looks like this:\n```py\nclass Template:  # TODO: consider making `Template` generic on `TypeVarTuple`\n    strings: tuple[str, ...]\n    interpolations: tuple[Interpolation, ...]\n\n    def __new__(cls, *args: str | Interpolation) -> Template: ...\n    def __iter__(self) -> Iterator[str | Interpolation]: ...\n    def __add__(self, other: Template, /) -> Template: ...\n    def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...\n    @property\n    def values(self) -> tuple[Any, ...]: ...  # Tuple of interpolation values, which can have any type\n\n@final\nclass Interpolation:\n    value: Any  # TODO: consider making `Interpolation` generic in runtime\n    expression: str\n    conversion: Literal[\"a\", \"r\", \"s\"] | None\n    format_spec: str\n\n    __match_args__ = (\"value\", \"expression\", \"conversion\", \"format_spec\")\n\n    def __new__(\n        cls, value: Any, expression: str = \"\", conversion: Literal[\"a\", \"r\", \"s\"] | None = None, format_spec: str = \"\"\n    ) -> Interpolation: ...\n    def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...\n```\n\nAnd it would need to be updated to something like this (using newer syntax for this example):\n```py\nfrom types import GenericAlias\nfrom typing import Any, final, Iterator, Literal\n\nclass Template[*Ts]:\n    strings: tuple[str, ...]\n    interpolations: tuple[Interpolation[Ts], ...]  # Not possible to map/transform onto interpolations\n\n    def __new__(cls, *args: str | Interpolation[Ts]) -> Template: ...  # Not possible to map/transform onto interpolations\n    def __iter__(self) -> Iterator[str | Interpolation[Ts]]: ...  # Not possible to map/transform onto interpolations\n    def __add__[*OtherTs](self, other: Template[*OtherTs], /) -> Template[*Ts, *OtherTs]: ...\n    def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...\n    @property\n    def values(self) -> tuple[*Ts]: ...\n\n@final\nclass Interpolation[T]:\n    value: T\n    expression: str\n    conversion: Literal[\"a\", \"r\", \"s\"] | None\n    format_spec: str\n\n    __match_args__ = (\"value\", \"expression\", \"conversion\", \"format_spec\")\n\n    def __new__(\n        cls, value: T, expression: str = \"\", conversion: Literal[\"a\", \"r\", \"s\"] | None = None, format_spec: str = \"\"\n    ) -> Interpolation[T]: ...\n    def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...\n```\nSo basically we would need to map the `TypeVarTuple`'s elements into each `Interpolation`, which is currently not possible.\n\nSo it looks like typing `Templates` and `Interpolations` is not possible until transformations get added. If I missed something or there is a workaround, please inform me! Thank you! 👍 ","author":{"url":"https://github.com/JoniKauf","@type":"Person","name":"JoniKauf"},"datePublished":"2025-10-15T09:50:19Z","url":"https://github.com/python/typeshed/issues/14878"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:39a69e04-7620-aace-ebf2-dacf7db6d466
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBAB8:184B81:361DEDE:47FCB45:6B004C4A
html-safe-noncea00e2350576ac1ea773c5b2d38f3970e2ebab28d957020d5cc2a8f46c292c270
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUI4OjE4NEI4MTozNjFERURFOjQ3RkNCNDU6NkIwMDRDNEEiLCJ2aXNpdG9yX2lkIjoiNDI4Njc0ODM3ODYzNDg0NDkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace36b51ff6157628e415c839dcdfaa1a2ad6455f884d816722cb93baaaee6dfed
hovercard-subject-tagissue:3517247242
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typeshed/14878/issue_layout
twitter:imagehttps://opengraph.githubassets.com/80da4a7a3674f11308103ce1c5c5a188b5639eac2dde3e9ac2d18e39f9002bdb/python/typeshed/issues/14878
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/80da4a7a3674f11308103ce1c5c5a188b5639eac2dde3e9ac2d18e39f9002bdb/python/typeshed/issues/14878
og:image:altI recently tried to create my own stubs for Python 3.14's Template and Interpolation types, but it seems that is currently not possible. I waited a while and searched a lot and did not find anybody...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJoniKauf
hostnamegithub.com
expected-hostnamegithub.com
Nonef9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b
turbo-cache-controlno-preview
go-importgithub.com/python/typeshed git https://github.com/python/typeshed.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id31696383
octolytics-dimension-repository_nwopython/typeshed
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31696383
octolytics-dimension-repository_network_root_nwopython/typeshed
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb27c5dde30676028abd5c5fc53ce5c9b625f8281
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typeshed/issues/14878#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F14878
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F14878
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Ftypeshed
Reloadhttps://github.com/python/typeshed/issues/14878
Reloadhttps://github.com/python/typeshed/issues/14878
Reloadhttps://github.com/python/typeshed/issues/14878
pythonhttps://github.com/python
typeshedhttps://github.com/python/typeshed
Codehttps://github.com/python/typeshed
Issues196 (196)https://github.com/python/typeshed/issues
Pull requests252 (252)https://github.com/python/typeshed/pulls
Actionshttps://github.com/python/typeshed/actions
Security and qualityhttps://github.com/python/typeshed/security
Insightshttps://github.com/python/typeshed/insights
https://github.com/python/typeshed
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/14878
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/14878
(3.14) Templates not typeable without TypeVarTuple transformationshttps://github.com/python/typeshed/issues/14878#top
https://github.com/JoniKauf
JoniKaufhttps://github.com/JoniKauf
on Oct 15, 2025https://github.com/python/typeshed/issues/14878#issue-3517247242
python/cpython#133970https://github.com/python/cpython/issues/133970
python/typing#1216https://github.com/python/typing/issues/1216
https://github.com/JoniKauf
JoniKaufhttps://github.com/JoniKauf
on Oct 15, 2025https://github.com/python/typeshed/issues/14878#issuecomment-3405552365
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 15, 2025https://github.com/python/typeshed/issues/14878#issuecomment-3407235612
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typeshed/issues/14878
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typeshed/issues/14878
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.