René's URL Explorer Experiment


Title: `generics_defaults.py` mandates that type checkers should allow a class that raises `TypeError` at runtime · Issue #2211 · python/typing · GitHub

Open Graph Title: `generics_defaults.py` mandates that type checkers should allow a class that raises `TypeError` at runtime · Issue #2211 · python/typing

X Title: `generics_defaults.py` mandates that type checkers should allow a class that raises `TypeError` at runtime · Issue #2211 · python/typing

Description: This test mandates that type checkers should allow classes that have ParamSpecs-with-defaults following TypeVarTuples: typing/conformance/tests/generics_defaults.py Lines 191 to 200 in 22d9392 # > It is allowed to have a ``ParamSpec`` wi...

Open Graph Description: This test mandates that type checkers should allow classes that have ParamSpecs-with-defaults following TypeVarTuples: typing/conformance/tests/generics_defaults.py Lines 191 to 200 in 22d9392 # > ...

X Description: This test mandates that type checkers should allow classes that have ParamSpecs-with-defaults following TypeVarTuples: typing/conformance/tests/generics_defaults.py Lines 191 to 200 in 22d9392 # &g...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`generics_defaults.py` mandates that type checkers should allow a class that raises `TypeError` at runtime","articleBody":"This test mandates that type checkers should allow classes that have `ParamSpec`s-with-defaults following `TypeVarTuple`s: https://github.com/python/typing/blob/22d9392a5ead302cc02c47ecbbcf3aa40106fd9f/conformance/tests/generics_defaults.py#L191-L200\n\nBut these fail at runtime. Using Python 3.11 syntax:\n\n```pytb\n% uvx python3.14       \nPython 3.14.0 (main, Oct 10 2025, 12:54:13) [Clang 20.1.4 ] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> from typing import *\n>>> Ts = TypeVarTuple(\"Ts\")\n>>> P = ParamSpec(\"P\", default=[int, str])\n>>> class A(Generic[*Ts, P]): ...\n... \nTraceback (most recent call last):\n  File \"\u003cpython-input-3>\", line 1, in \u003cmodule>\n    class A(Generic[*Ts, P]): ...\n            ~~~~~~~^^^^^^^^\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 402, in inner\n    return func(*args, **kwds)\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 1157, in _generic_class_getitem\n    return _GenericAlias(cls, args)\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 1334, in __init__\n    self.__parameters__ = _collect_type_parameters(\n                          ~~~~~~~~~~~~~~~~~~~~~~~~^\n        args,\n        ^^^^^\n        enforce_default_ordering=enforce_default_ordering,\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 291, in _collect_type_parameters\n    raise TypeError('Type parameter with a default'\n                    ' follows TypeVarTuple')\nTypeError: Type parameter with a default follows TypeVarTuple\n```\n\nUsing Python \u003c=3.10 syntax:\n\n```pytb\n>>> class B(Generic[Unpack[Ts], P]): ...\n... \nTraceback (most recent call last):\n  File \"\u003cpython-input-4>\", line 1, in \u003cmodule>\n    class B(Generic[Unpack[Ts], P]): ...\n            ~~~~~~~^^^^^^^^^^^^^^^\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 402, in inner\n    return func(*args, **kwds)\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 1157, in _generic_class_getitem\n    return _GenericAlias(cls, args)\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 1334, in __init__\n    self.__parameters__ = _collect_type_parameters(\n                          ~~~~~~~~~~~~~~~~~~~~~~~~^\n        args,\n        ^^^^^\n        enforce_default_ordering=enforce_default_ordering,\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 291, in _collect_type_parameters\n    raise TypeError('Type parameter with a default'\n                    ' follows TypeVarTuple')\nTypeError: Type parameter with a default follows TypeVarTuple\n```\n\nAnd using Python 3.13+ syntax:\n\n```pytb\n>>> class C[*Ts, **P = [int, str]]: ...\n... \nTraceback (most recent call last):\n  File \"\u003cpython-input-5>\", line 1, in \u003cmodule>\n    class C[*Ts, **P = [int, str]]: ...\n  File \"\u003cpython-input-5>\", line 1, in \u003cgeneric parameters of C>\n    class C[*Ts, **P = [int, str]]: ...\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 1334, in __init__\n    self.__parameters__ = _collect_type_parameters(\n                          ~~~~~~~~~~~~~~~~~~~~~~~~^\n        args,\n        ^^^^^\n        enforce_default_ordering=enforce_default_ordering,\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n    )\n    ^\n  File \"/Users/alexw/Library/Application Support/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/typing.py\", line 291, in _collect_type_parameters\n    raise TypeError('Type parameter with a default'\n                    ' follows TypeVarTuple')\nTypeError: Type parameter with a default follows TypeVarTuple\n```\n\nSince it seems that the tests are quoting the spec here, is this a bug in the runtime implementation of the typing module? Or should we update the spec and the conformance suite to allow type checkers to catch this runtime error?","author":{"url":"https://github.com/AlexWaygood","@type":"Person","name":"AlexWaygood"},"datePublished":"2026-03-08T16:53:27Z","url":"https://github.com/python/typing/issues/2211"}

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:0a91d083-3ade-d55f-598f-851f669ae0d0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8A3E:3E8A12:24A607:2F1A35:6AFF8614
html-safe-noncef3bccf7a77e417075fc4864f6f83472bf6ff9af7b04c854b33da6c5a9a8a95e6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTNFOjNFOEExMjoyNEE2MDc6MkYxQTM1OjZBRkY4NjE0IiwidmlzaXRvcl9pZCI6Ijg1MzA2OTk0NzQyOTU1NTU2MDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1b10cff2d95ef4802498d96a9a0d2fc6e7ee4c0945f4fcb427414402e615aaad
hovercard-subject-tagissue:4041698498
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/2211/issue_layout
twitter:imagehttps://opengraph.githubassets.com/85700ed6297f70af0a38c32f4c856627402da32c378ea82bf06e0eb9b3cfa84c/python/typing/issues/2211
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/85700ed6297f70af0a38c32f4c856627402da32c378ea82bf06e0eb9b3cfa84c/python/typing/issues/2211
og:image:altThis test mandates that type checkers should allow classes that have ParamSpecs-with-defaults following TypeVarTuples: typing/conformance/tests/generics_defaults.py Lines 191 to 200 in 22d9392 # > ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAlexWaygood
hostnamegithub.com
expected-hostnamegithub.com
None587ad99a3e443b2e1cb0d3df059ec49ab54389861f13310766dfdeb615fed90d
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
release5bb0fb68d64881d1344f5863d809515d496801e5
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/2211#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F2211
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%2F2211
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/2211
Reloadhttps://github.com/python/typing/issues/2211
Reloadhttps://github.com/python/typing/issues/2211
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/2211
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/2211
generics_defaults.py mandates that type checkers should allow a class that raises TypeError at runtimehttps://github.com/python/typing/issues/2211#top
topic: conformance testsIssues with the conformance test suitehttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20conformance%20tests%22
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Mar 8, 2026https://github.com/python/typing/issues/2211#issue-4041698498
typing/conformance/tests/generics_defaults.pyhttps://github.com/python/typing/blob/22d9392a5ead302cc02c47ecbbcf3aa40106fd9f/conformance/tests/generics_defaults.py#L191-L200
22d9392https://github.com/python/typing/commit/22d9392a5ead302cc02c47ecbbcf3aa40106fd9f
AlexWaygoodhttps://github.com/AlexWaygood
topic: conformance testsIssues with the conformance test suitehttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20conformance%20tests%22
on Mar 8, 2026https://github.com/python/typing/issues/2211#event-23374707392
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Mar 8, 2026https://github.com/python/typing/issues/2211#issuecomment-4019888709
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Mar 8, 2026https://github.com/python/typing/issues/2211#issuecomment-4019895786
https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuplehttps://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple
https://peps.python.org/pep-0696/#defaults-following-typevartuplehttps://peps.python.org/pep-0696/#defaults-following-typevartuple
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/2211
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/2211
topic: conformance testsIssues with the conformance test suitehttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20conformance%20tests%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.