René's URL Explorer Experiment


Title: Generic default type in `type` revealed as `Any` · Issue #21608 · python/mypy · GitHub

Open Graph Title: Generic default type in `type` revealed as `Any` · Issue #21608 · python/mypy

X Title: Generic default type in `type` revealed as `Any` · Issue #21608 · python/mypy

Description: Bug Report mypy reveals a certain nested default generic type in type as Any, while other type checkers reveal it as the default type. This issue is motivated by pandas-dev/pandas-stubs#1764. To Reproduce This is complicated, see #21608 ...

Open Graph Description: Bug Report mypy reveals a certain nested default generic type in type as Any, while other type checkers reveal it as the default type. This issue is motivated by pandas-dev/pandas-stubs#1764. To Re...

X Description: Bug Report mypy reveals a certain nested default generic type in type as Any, while other type checkers reveal it as the default type. This issue is motivated by pandas-dev/pandas-stubs#1764. To Re...

Opengraph URL: https://github.com/python/mypy/issues/21608

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generic default type in `type` revealed as `Any`","articleBody":"\u003c!--\nIf you're not sure whether what you're experiencing is a mypy bug, please see the \"Question and Help\" form instead.\nPlease consider:\n\n- checking our common issues page: https://mypy.readthedocs.io/en/stable/common_issues.html\n- searching our issue tracker: https://github.com/python/mypy/issues to see if it's already been reported\n- asking on gitter chat: https://gitter.im/python/typing\n-->\n\n**Bug Report**\n\n`mypy` reveals a certain ~~nested~~ default generic type in `type` as `Any`, while other type checkers reveal it as the default type.\n\nThis issue is motivated by pandas-dev/pandas-stubs#1764.\n\n**To Reproduce**\n\nThis is complicated, see https://github.com/python/mypy/issues/21608#issuecomment-4692751812 for a much simplified example.\n\n```python\nfrom typing import Any, Generic, TypeVar, reveal_type\n\n_ItemT_co = TypeVar(\"_ItemT_co\", default=Any, covariant=True)\n\nclass generic(Generic[_ItemT_co]): ...\n\n_ScalarT_co = TypeVar(\"_ScalarT_co\", bound=generic, default=Any, covariant=True)\n\nclass dtype(Generic[_ScalarT_co]): ...\n\n_DT64ItemT_co = TypeVar(\n    \"_DT64ItemT_co\", bound=int | None, default=int | None, covariant=True\n)\n\nclass datetime64(generic[_DT64ItemT_co], Generic[_DT64ItemT_co]): ...\n\nGenericT_co = TypeVar(\"GenericT_co\", bound=generic, default=Any, covariant=True)\nGenericT = TypeVar(\"GenericT\", bound=generic, default=Any)\n\nclass Series(Generic[GenericT_co]):\n    def to_numpy_simplified(\n        self, dtype: dtype[GenericT] | type[GenericT]\n    ) -> GenericT: ...\n\nreveal_type(Series().to_numpy_simplified(datetime64))  # mypy: datetime64[Any], pyright & pyright: datetime64[int | None]\n```\n- https://gist.github.com/mypy-play/099705d9f12556f66776949caa6f0450\n- https://pyright-play.net/?strict=true&code=GYJw9gtgBALgngBwJYDsDmUkQWEMoCCKcANFAOICmKlISAxmQCqKUBqAhiGSJQG6UOAGwD68BJQCwAKBkiAkjEoQmI%2BmCgBeKCwmcQACgBECpSrVgjZACaVgHAK5CYmoqSjq%2BXJBxQumIA6UAJQyMvRCHADOUVBo1LQMBlQ0dPQA2qbKquoAusEAXFAAdKVh0iIAyvTCXDka2rrsXMZVNZEg9VZQAEZgDijWmvGpDDZ2js6uxGSe3r7%2BgSHlEdGx1uKUyQlpmdW1nRb5RaXF5SIAIkwAbAAsitkWWjqs%2BgYyUJ9QJld3D%2Bbqbp9AZDVD4AA%2BUAAcmAaON7E4XGCoJCYXCPGAvHQFpoAkEZKFZNJVjEoNYOEoYFhKHcDCNEhlLjd7mZ6rkyCkGZlfizHnlCiUykTOWl6s8mm8jCKGF0yMDBsMdmMyRNEdN3HNsX5cUtCdL6Exxa8WlKlQagf0FfS0vDJi43ITwpFSZVEpQottRhl9WzCh8vrZgLAwCIUA5sHARFEsAghEhgEhKNZ3tIvmmoFFKEJgDZNkUNqx0j7cijYIXi-7PsEoABaAB8FDNTBOQpkvAEwjErAMrro7oMwWKMBDYYjUZjcYTSYM5Mp1LuwUJQA\n- https://play.ty.dev/8c070d59-a962-4cd0-823f-fa8dd9941f4f\n\n**Expected Behavior**\n\n`datetime64[int | None]`\n\n**Actual Behavior**\n\n`datetime64[Any]`","author":{"url":"https://github.com/cmp0xff","@type":"Person","name":"cmp0xff"},"datePublished":"2026-06-12T15:31:35Z","url":"https://github.com/python/mypy/issues/21608"}

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:5dc21e5d-bbce-03db-bb9f-b2d7586b7779
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC08E:43251:173A5BA:1EE9BC4:6B002AA4
html-safe-nonce9f0b1c91b66d50e35c00081959177c06ee84ce1494fb06e6da2b40d66dfbfb29
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDhFOjQzMjUxOjE3M0E1QkE6MUVFOUJDNDo2QjAwMkFBNCIsInZpc2l0b3JfaWQiOiIyNTE3MjAxMTA3OTkwNzE5MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac97ac099ded7d8b1349aa525bd2a10f5803419c1df9be1d4f6fb9aab370a472c8
hovercard-subject-tagissue:4650512799
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/mypy/21608/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9b692cec6306b8118a2ddbeb6e61837092aa931ac4456b7134ebaa0d9bfec521/python/mypy/issues/21608
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9b692cec6306b8118a2ddbeb6e61837092aa931ac4456b7134ebaa0d9bfec521/python/mypy/issues/21608
og:image:altBug Report mypy reveals a certain nested default generic type in type as Any, while other type checkers reveal it as the default type. This issue is motivated by pandas-dev/pandas-stubs#1764. To Re...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecmp0xff
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/21608#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F21608
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%2Fmypy%2Fissues%2F21608
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%2Fmypy
Reloadhttps://github.com/python/mypy/issues/21608
Reloadhttps://github.com/python/mypy/issues/21608
Reloadhttps://github.com/python/mypy/issues/21608
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests547 (547)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/21608
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/21608
#22044https://github.com/python/mypy/pull/22044
Generic default type in type revealed as Anyhttps://github.com/python/mypy/issues/21608#top
#22044https://github.com/python/mypy/pull/22044
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-pep-696TypeVar defaultshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-696%22
https://github.com/cmp0xff
cmp0xffhttps://github.com/cmp0xff
on Jun 12, 2026https://github.com/python/mypy/issues/21608#issue-4650512799
pandas-dev/pandas-stubs#1764https://github.com/pandas-dev/pandas-stubs/pull/1764
#21608 (comment)https://github.com/python/mypy/issues/21608#issuecomment-4692751812
https://gist.github.com/mypy-play/099705d9f12556f66776949caa6f0450https://gist.github.com/mypy-play/099705d9f12556f66776949caa6f0450
https://pyright-play.net/?strict=true&code=GYJw9gtgBALgngBwJYDsDmUkQWEMoCCKcANFAOICmKlISAxmQCqKUBqAhiGSJQG6UOAGwD68BJQCwAKBkiAkjEoQmI%2BmCgBeKCwmcQACgBECpSrVgjZACaVgHAK5CYmoqSjq%2BXJBxQumIA6UAJQyMvRCHADOUVBo1LQMBlQ0dPQA2qbKquoAusEAXFAAdKVh0iIAyvTCXDka2rrsXMZVNZEg9VZQAEZgDijWmvGpDDZ2js6uxGSe3r7%2BgSHlEdGx1uKUyQlpmdW1nRb5RaXF5SIAIkwAbAAsitkWWjqs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d0-823f-fa8dd9941f4f
cmp0xffhttps://github.com/cmp0xff
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Jun 12, 2026https://github.com/python/mypy/issues/21608#event-26682432652
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Jun 12, 2026https://github.com/python/mypy/issues/21608#issuecomment-4692751812
JelleZijlstrahttps://github.com/JelleZijlstra
topic-pep-696TypeVar defaultshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-696%22
on Jun 12, 2026https://github.com/python/mypy/issues/21608#event-26682694491
cmp0xffhttps://github.com/cmp0xff
on Jun 12, 2026https://github.com/python/mypy/issues/21608#event-26683183634
fix: python/mypy#21608https://github.com/cmp0xff/pandas-stubs/commit/110baf3dc6f671f55e0b67c69393d74e6c0a227e
python/mypy#21608https://github.com/python/mypy/issues/21608
https://docs.github.com/articles/closing-issues-via-commit-messages
110baf3https://github.com/cmp0xff/pandas-stubs/commit/110baf3dc6f671f55e0b67c69393d74e6c0a227e
cmp0xffhttps://github.com/cmp0xff
on Jun 12, 2026https://github.com/python/mypy/issues/21608#event-26683408928
loicdiridollouhttps://github.com/loicdiridollou
on Jun 12, 2026https://github.com/python/mypy/issues/21608#event-26683754963
BUG: 🌃 `mypy` nightly (#1764)https://github.com/pandas-dev/pandas-stubs/commit/6255df594e4ed47d427ab71665a8ff851a8336ca
#1764https://github.com/pandas-dev/pandas-stubs/pull/1764
https://docs.github.com/articles/closing-issues-via-commit-messages
6255df5https://github.com/pandas-dev/pandas-stubs/commit/6255df594e4ed47d427ab71665a8ff851a8336ca
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 14, 2026https://github.com/python/mypy/issues/21608#issuecomment-4700265106
#20354https://github.com/python/mypy/issues/20354
cmp0xffhttps://github.com/cmp0xff
on Aug 28, 2026https://github.com/python/mypy/issues/21608#event-30184302952
BUG: 🌃 `mypy` nightly (pandas-dev#1764)https://github.com/cmp0xff/pandas-stubs/commit/503daceea9b634de2ed00ddd9c7f1f3085835411
pandas-dev#1764https://github.com/pandas-dev/pandas-stubs/pull/1764
https://docs.github.com/articles/closing-issues-via-commit-messages
503dacehttps://github.com/cmp0xff/pandas-stubs/commit/503daceea9b634de2ed00ddd9c7f1f3085835411
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/21608
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/21608
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-pep-696TypeVar defaultshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-696%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.