René's URL Explorer Experiment


Title: TypeVarTuple Transformations Before Unpack · Issue #1216 · python/typing · GitHub

Open Graph Title: TypeVarTuple Transformations Before Unpack · Issue #1216 · python/typing

X Title: TypeVarTuple Transformations Before Unpack · Issue #1216 · python/typing

Description: It would be useful to be able to apply type transformations to TypeVarTuple's types. Some motivating examples: Ts = TypeVarTuple('Ts') class Example(Generic[*Ts]): def __init__(self, *types: *type[Ts]) -> None: self.types = types def cre...

Open Graph Description: It would be useful to be able to apply type transformations to TypeVarTuple's types. Some motivating examples: Ts = TypeVarTuple('Ts') class Example(Generic[*Ts]): def __init__(self, *types: *type[...

X Description: It would be useful to be able to apply type transformations to TypeVarTuple's types. Some motivating examples: Ts = TypeVarTuple('Ts') class Example(Generic[*Ts]): def __init__(self, *t...

Opengraph URL: https://github.com/python/typing/issues/1216

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeVarTuple Transformations Before Unpack","articleBody":"It would be useful to be able to apply type transformations to `TypeVarTuple`'s types.  Some motivating examples:\r\n\r\n```python\r\n Ts = TypeVarTuple('Ts')\r\n\r\n class Example(Generic[*Ts]):\r\n     def __init__(self, *types: *type[Ts]) -> None:\r\n         self.types = types\r\n\r\n     def create_defaults(self) -> tuple[*Ts]:\r\n         return tuple(t() for t in self.types)\r\n\r\n     def create_lists(self) -> tuple[*list[Ts]]:\r\n         return tuple([t()] for t in self.types)\r\n\r\n     def create_callables(self) -> tuple[*Callable[[], Ts]]:\r\n         return tuple(lambda: t() for t in self.types)\r\n\r\n e = Example(int, str)\r\n\r\n assert_type(e.create_defaults(), tuple[int, str])\r\n assert_type(e.create_lists(), tuple[list[int], list[str]])\r\n assert_type(e.create_callables(), tuple[Callable[[], int], Callable[[], str]])\r\n```\r\nAt a high level, everything between the `*` and the `TypeVarTuple` it expands would be applied per type in the tuple before it's unpacked.\r\n\r\nThere are some decisions to be made about how the expansion is done if there are multiple `TypeVarTuple`s in the expand expression, but I think it can be supported and I think the intuitive thing would be to zip up all the `TypeVarTuple`s.  For example,\r\n`tuple[*tuple[Ts, Us]]` with `Ts = (int, str)` and `Us = (float, bytes)` would be `tuple[tuple[int, float], tuple[str, bytes]]`, with the implementation enforcing equal-length `TypeVarTuple`s.\r\n\r\nIf there's a workaround for this using the existing logic, let me know.  My current use case involves keeping a reference to the runtime types, so `*type[Ts]` is what I'm looking for at the moment.","author":{"url":"https://github.com/llchan","@type":"Person","name":"llchan"},"datePublished":"2022-06-24T21:18:23Z","url":"https://github.com/python/typing/issues/1216"}

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:3982be12-a094-10bc-29af-1c73943fb1ff
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBA6C:2D8191:458C9:5C0F5:6B001A6A
html-safe-nonce6f92ebe3bce5e68d4ab979b587b78165ffe07a9076e76914d357900d4cb97ef2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTZDOjJEODE5MTo0NThDOTo1QzBGNTo2QjAwMUE2QSIsInZpc2l0b3JfaWQiOiIxNDM3NzQ2MzY4NjI0OTkwODI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd1fcc20cbd093d327a342276659a67bda6b93c490780111ddfd5ee5548ed8b7d
hovercard-subject-tagissue:1284201833
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/typing/1216/issue_layout
twitter:imagehttps://opengraph.githubassets.com/68082f5fc15a55c24907bc75d3bbac73eef2e7f840164655a2ab185d8325568a/python/typing/issues/1216
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/68082f5fc15a55c24907bc75d3bbac73eef2e7f840164655a2ab185d8325568a/python/typing/issues/1216
og:image:altIt would be useful to be able to apply type transformations to TypeVarTuple's types. Some motivating examples: Ts = TypeVarTuple('Ts') class Example(Generic[*Ts]): def __init__(self, *types: *type[...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamellchan
hostnamegithub.com
expected-hostnamegithub.com
Nonea2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4
turbo-cache-controlno-preview
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
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
release70121d4e855ee0bb7b75cf15d061d91f8863c0f8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/1216#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F1216
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%2Ftyping%2Fissues%2F1216
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%2Ftyping
Reloadhttps://github.com/python/typing/issues/1216
Reloadhttps://github.com/python/typing/issues/1216
Reloadhttps://github.com/python/typing/issues/1216
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
https://github.com/python/typing
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/1216
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/1216
TypeVarTuple Transformations Before Unpackhttps://github.com/python/typing/issues/1216#top
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
https://github.com/llchan
llchanhttps://github.com/llchan
on Jun 24, 2022https://github.com/python/typing/issues/1216#issue-1284201833
llchanhttps://github.com/llchan
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
on Jun 24, 2022https://github.com/python/typing/issues/1216#event-6876882540
https://github.com/pradeep90
pradeep90https://github.com/pradeep90
on Jun 27, 2022https://github.com/python/typing/issues/1216#issuecomment-1166703369
@llchanhttps://github.com/llchan
https://github.com/llchan
llchanhttps://github.com/llchan
on Jun 27, 2022https://github.com/python/typing/issues/1216#issuecomment-1167675723
https://github.com/uriyyo
uriyyohttps://github.com/uriyyo
on Dec 13, 2022https://github.com/python/typing/issues/1216#issuecomment-1348592005
@pradeep90https://github.com/pradeep90
https://github.com/maflAT
maflAThttps://github.com/maflAT
on May 12, 2023https://github.com/python/typing/issues/1216#issuecomment-1545693994
https://stackoverflow.com/questions/76234660/type-hinting-instances-vs-types-with-variadic-genericshttps://stackoverflow.com/questions/76234660/type-hinting-instances-vs-types-with-variadic-generics
llucaxhttps://github.com/llucax
on Jun 9, 2023https://github.com/python/typing/issues/1216#event-9483347320
Add a new async iterable select() functionhttps://github.com/llucax/frequenz-channels-python/commit/a2410bbc4a7dfbd3344fd6dad08e7ab965f7639d
a2410bbhttps://github.com/llucax/frequenz-channels-python/commit/a2410bbc4a7dfbd3344fd6dad08e7ab965f7639d
llucaxhttps://github.com/llucax
on Jun 19, 2023https://github.com/python/typing/issues/1216#event-9568058869
Add a new async iterable select() functionhttps://github.com/llucax/frequenz-channels-python/commit/2764d0171d926bc2e41c29eca45a719fcc797f3f
2764d01https://github.com/llucax/frequenz-channels-python/commit/2764d0171d926bc2e41c29eca45a719fcc797f3f
https://github.com/yakMM
yakMMhttps://github.com/yakMM
on Aug 20, 2023https://github.com/python/typing/issues/1216#issuecomment-1685365706
https://github.com/Kroppeb
Kroppebhttps://github.com/Kroppeb
on Sep 13, 2023https://github.com/python/typing/issues/1216#issuecomment-1718225566
https://github.com/Gobot1234
Gobot1234https://github.com/Gobot1234
on Sep 16, 2023https://github.com/python/typing/issues/1216#issuecomment-1722277156
https://github.com/insilications
insilicationshttps://github.com/insilications
on Oct 7, 2023https://github.com/python/typing/issues/1216#issuecomment-1751809860
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
on Oct 21, 2023https://github.com/python/typing/issues/1216#issuecomment-1773793227
#1273https://github.com/python/typing/issues/1273
@zen-xuhttps://github.com/zen-xu
https://github.com/phdowling
phdowlinghttps://github.com/phdowling
on Nov 19, 2023https://github.com/python/typing/issues/1216#issuecomment-1817981758
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
on Dec 20, 2023https://github.com/python/typing/issues/1216#issuecomment-1864245331
this discussionhttps://github.com/python/typing/discussions/1545#discussioncomment-7869592
@zen-xuhttps://github.com/zen-xu
https://github.com/Kroppeb
Kroppebhttps://github.com/Kroppeb
on Jan 21, 2024https://github.com/python/typing/issues/1216#issuecomment-1902739126
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
on Jan 21, 2024https://github.com/python/typing/issues/1216#issuecomment-1902788499
typeshedhttps://github.com/python/typeshed/blob/2168ab5ff4e40c37505b3e5048944603b71a857d/stdlib/builtins.pyi#L1396C1-L1397C1
https://github.com/tanrbobanr
tanrbobanrhttps://github.com/tanrbobanr
on Mar 27, 2024https://github.com/python/typing/issues/1216#issuecomment-2023979105
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Mar 27, 2024https://github.com/python/typing/issues/1216#issuecomment-2023992848
herehttps://discuss.python.org/c/typing/32
https://github.com/tanrbobanr
tanrbobanrhttps://github.com/tanrbobanr
on Mar 27, 2024https://github.com/python/typing/issues/1216#issuecomment-2024056019
https://github.com/zen-xu
zen-xuhttps://github.com/zen-xu
on May 23, 2024https://github.com/python/typing/issues/1216#issuecomment-2126153831
https://github.com/ahmed-mahran
ahmed-mahranhttps://github.com/ahmed-mahran
on Aug 8, 2024https://github.com/python/typing/issues/1216#issuecomment-2276350477
https://github.com/ahmed-mahran/funpy/blob/main/typeargs.pyhttps://github.com/ahmed-mahran/funpy/blob/main/typeargs.py
https://github.com/ahmed-mahran/funpy/blob/main/mapped.pyhttps://github.com/ahmed-mahran/funpy/blob/main/mapped.py
https://github.com/jorenham
jorenhamhttps://github.com/jorenham
on Aug 8, 2024https://github.com/python/typing/issues/1216#issuecomment-2276525900
@ahmed-mahranhttps://github.com/ahmed-mahran
#548https://github.com/python/typing/issues/548
https://github.com/bharel
bharelhttps://github.com/bharel
on Sep 5, 2024https://github.com/python/typing/issues/1216#issuecomment-2332669655
https://stackoverflow.com/q/73200382/1658617https://stackoverflow.com/q/73200382/1658617
https://stackoverflow.com/q/78954770/1658617https://stackoverflow.com/q/78954770/1658617
https://github.com/fzimmermann89
fzimmermann89https://github.com/fzimmermann89
on Sep 25, 2024https://github.com/python/typing/issues/1216#issuecomment-2373839511
https://stackoverflow.com/questions/78013162/typehint-function-args-tupleargs-with-constraint-on-the-argshttps://stackoverflow.com/questions/78013162/typehint-function-args-tupleargs-with-constraint-on-the-args
https://github.com/vdozier-work
vdozier-workhttps://github.com/vdozier-work
on Jan 21, 2025https://github.com/python/typing/issues/1216#issuecomment-2605700652
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/1216
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/1216
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
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.