René's URL Explorer Experiment


Title: Introduce an Unknown type · Issue #1835 · python/typing · GitHub

Open Graph Title: Introduce an Unknown type · Issue #1835 · python/typing

X Title: Introduce an Unknown type · Issue #1835 · python/typing

Description: Unknown Definition A type that can only be cast to Any Problem Currently when type checkers fail to understand the type of a function/variable, they fallback on Any. T = TypeVar("T") def foo(fn: Callable[[], T]) -> T: return fn() bar = f...

Open Graph Description: Unknown Definition A type that can only be cast to Any Problem Currently when type checkers fail to understand the type of a function/variable, they fallback on Any. T = TypeVar("T") def foo(fn: Ca...

X Description: Unknown Definition A type that can only be cast to Any Problem Currently when type checkers fail to understand the type of a function/variable, they fallback on Any. T = TypeVar("T") def ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Introduce an Unknown type","articleBody":"\u003c!-- Please describe the problem you face as well as your idea below, ideally using examples for both. -->\n\n## `Unknown` Definition\nA type that can only be cast to `Any`\n\n## Problem\n\nCurrently when type checkers fail to understand the type of a function/variable, they fallback on `Any`.\n\n```python\nT = TypeVar(\"T\")\n\ndef foo(fn: Callable[[], T]) -> T:\n  return fn()\n\nbar = foo(lambda: 5)\n\n# The type of bar will fallback on `Any` so the type checker will not warn on misuse\n_ = bar[0]\n```\n\n## Suggestion\n\nIf an `Unknown` type is introduced, and can be defined as a fallback in the checker then all operations performed on it (that assume a specific type) will fail.\n\n```python\nT = TypeVar(\"T\")\n\ndef foo(fn: Callable[[], T]) -> T:\n  return fn()\n\nbar = foo(lambda: 5)\n\n# The checker will mark this as an error because subscripting is not defined on \n`Unknown`.\n_ = bar[0]\n```\n\n## Inspirations\n\nTypescript: https://www.typescriptlang.org/docs/handbook/type-compatibility.html#any-unknown-object-void-undefined-null-and-never-assignability\n\n> `any` and `unknown` are the same in terms of what is assignable to them, different in that `unknown` is not assignable to anything except `any`.\n> \n> `unknown` and `never` are like inverses of each other. Everything is assignable to `unknown`, `never` is assignable to everything. Nothing is assignable to `never`, `unknown` is not assignable to anything (except `any`).","author":{"url":"https://github.com/Eyal-Shalev","@type":"Person","name":"Eyal-Shalev"},"datePublished":"2024-08-08T06:15:54Z","url":"https://github.com/python/typing/issues/1835"}

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:06692e04-91db-c91b-36ef-71045dcd7d60
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE034:34730F:24AE4F:2F7EBB:6AFF8401
html-safe-nonce144c5789f083cdc03483723cdb60187c22a78849b9f738a5da6b3cfe21584d55
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDM0OjM0NzMwRjoyNEFFNEY6MkY3RUJCOjZBRkY4NDAxIiwidmlzaXRvcl9pZCI6Ijg5MjA0NTYzMjMyMDQ2MTMxMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac416e9dd008c7bc743d32057087f987dfcfc7fe25c63568813ac864caebb08ca9
hovercard-subject-tagissue:2454958518
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/1835/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6d7f48d4bba327e828bb5404e05ae02c45d3d28c46a64419f21bf70350ff5847/python/typing/issues/1835
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6d7f48d4bba327e828bb5404e05ae02c45d3d28c46a64419f21bf70350ff5847/python/typing/issues/1835
og:image:altUnknown Definition A type that can only be cast to Any Problem Currently when type checkers fail to understand the type of a function/variable, they fallback on Any. T = TypeVar("T") def foo(fn: Ca...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEyal-Shalev
hostnamegithub.com
expected-hostnamegithub.com
None19488db4031f00b04ea79b4c70b5dd32cfa873a8d20b3877f3896b8e2d195946
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
release7952f5285f4ba685d70c4c7540ad3cc9dc9746b8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/1835#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F1835
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%2F1835
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/1835
Reloadhttps://github.com/python/typing/issues/1835
Reloadhttps://github.com/python/typing/issues/1835
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/1835
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/1835
Introduce an Unknown typehttps://github.com/python/typing/issues/1835#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/Eyal-Shalev
Eyal-Shalevhttps://github.com/Eyal-Shalev
on Aug 8, 2024https://github.com/python/typing/issues/1835#issue-2454958518
https://www.typescriptlang.org/docs/handbook/type-compatibility.html#any-unknown-object-void-undefined-null-and-never-assignabilityhttps://www.typescriptlang.org/docs/handbook/type-compatibility.html#any-unknown-object-void-undefined-null-and-never-assignability
Eyal-Shalevhttps://github.com/Eyal-Shalev
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 Aug 8, 2024https://github.com/python/typing/issues/1835#event-13801640863
https://github.com/srittau
srittauhttps://github.com/srittau
on Aug 8, 2024https://github.com/python/typing/issues/1835#issuecomment-2275120442
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Aug 8, 2024https://github.com/python/typing/issues/1835#issuecomment-2275137427
@srittauhttps://github.com/srittau
the pyright documentationhttps://microsoft.github.io/pyright/#/type-inference?id=unknown-type
pyright playgroundhttps://pyright-play.net/?strict=true&code=GYJw9gtgBMZlBLCAHMIAuUCuA7A1jmAO44D6AzgJ4QBGYANlFAMRTqXICmAXIgOaEQnALAAoMTQCGIKAF5s%2BQiQrU69ABQBKMWKEA3TpPql2XdVJDbxogB5yoFgNoAGALpigA
https://github.com/Eyal-Shalev
Eyal-Shalevhttps://github.com/Eyal-Shalev
on Aug 8, 2024https://github.com/python/typing/issues/1835#issuecomment-2276864237
@srittauhttps://github.com/srittau
the pyright documentationhttps://microsoft.github.io/pyright/#/type-inference?id=unknown-type
pyright playgroundhttps://pyright-play.net/?strict=true&code=GYJw9gtgBMZlBLCAHMIAuUCuA7A1jmAO44D6AzgJ4QBGYANlFAMRTqXICmAXIgOaEQnALAAoMTQCGIKAF5s%2BQiQrU69ABQBKMWKEA3TpPql2XdVJDbxogB5yoFgNoAGALpigA
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2419316417
https://github.com/srittau
srittauhttps://github.com/srittau
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2419343714
srittauhttps://github.com/srittau
not plannedhttps://github.com/python/typing/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 17, 2024https://github.com/python/typing/issues/1835#event-14698004695
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2420052730
https://github.com/srittau
srittauhttps://github.com/srittau
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2420075483
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2420088610
https://github.com/srittau
srittauhttps://github.com/srittau
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2420103380
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Oct 17, 2024https://github.com/python/typing/issues/1835#issuecomment-2420184863
@srittauhttps://github.com/srittau
https://github.com/septatrix
septatrixhttps://github.com/septatrix
on Nov 21, 2024https://github.com/python/typing/issues/1835#issuecomment-2491186312
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Nov 21, 2024https://github.com/python/typing/issues/1835#issuecomment-2491216394
https://github.com/carljm
carljmhttps://github.com/carljm
on Nov 21, 2024https://github.com/python/typing/issues/1835#issuecomment-2492312212
https://github.com/Eyal-Shalev
Eyal-Shalevhttps://github.com/Eyal-Shalev
on Nov 22, 2024https://github.com/python/typing/issues/1835#issuecomment-2493065585
https://github.com/Eyal-Shalev
Eyal-Shalevhttps://github.com/Eyal-Shalev
on Nov 22, 2024https://github.com/python/typing/issues/1835#issuecomment-2493088677
https://github.com/carljm
carljmhttps://github.com/carljm
on Nov 22, 2024https://github.com/python/typing/issues/1835#issuecomment-2494170142
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Dec 12, 2024https://github.com/python/typing/issues/1835#issuecomment-2537485551
@carljmhttps://github.com/carljm
https://private-user-images.githubusercontent.com/112889052/394966224-82b5d891-6549-4d72-91c3-79a2481b5c84.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUxMzA2NzAsIm5iZiI6MTc5NTEzMDM3MCwicGF0aCI6Ii8xMTI4ODkwNTIvMzk0OTY2MjI0LTgyYjVkODkxLTY1NDktNGQ3Mi05MWMzLTc5YTI0ODFiNWM4NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYxMTE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MTExOVQyMzE5MzBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNjU0ZWQwZDk1OWE5ODliNmYwOThmYmUyMzkzOWQ1ZjkxZGI5NDkxM2QxYTIzMDY5ZDBiZTQ4ZWU2MTc3MWI2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.d9fbZ_YkGFhruM9vVsalPh7KJffI8EXKPoAK7NbASzM
https://github.com/septatrix
septatrixhttps://github.com/septatrix
on Dec 16, 2024https://github.com/python/typing/issues/1835#issuecomment-2544220014
https://github.com/rmccampbell
rmccampbellhttps://github.com/rmccampbell
on Oct 24, 2025https://github.com/python/typing/issues/1835#issuecomment-3440865904
https://github.com/vtgn
vtgnhttps://github.com/vtgn
on Oct 24, 2025https://github.com/python/typing/issues/1835#issuecomment-3441738171
https://github.com/vladfi1
vladfi1https://github.com/vladfi1
on Feb 6, 2026https://github.com/python/typing/issues/1835#issuecomment-3862061036
srittauhttps://github.com/srittau
Introduce a type for an unknown invariant generic param that behaves strictly #2169https://github.com/python/typing/issues/2169
on Feb 9, 2026https://github.com/python/typing/issues/1835#event-22652023023
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/1835
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/1835
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.