René's URL Explorer Experiment


Title: isinstance(x, Type) not accepted · Issue #3060 · python/mypy · GitHub

Open Graph Title: isinstance(x, Type) not accepted · Issue #3060 · python/mypy

X Title: isinstance(x, Type) not accepted · Issue #3060 · python/mypy

Description: isinstance(x, Type) generates in an error, even though it should probably be considered equivalent to isinstance(x, type). Example: from typing import Type def f(x: Type[int]) -> None: if isinstance(x, Type): # Argument 2 to "isinstance"...

Open Graph Description: isinstance(x, Type) generates in an error, even though it should probably be considered equivalent to isinstance(x, type). Example: from typing import Type def f(x: Type[int]) -> None: if isinstanc...

X Description: isinstance(x, Type) generates in an error, even though it should probably be considered equivalent to isinstance(x, type). Example: from typing import Type def f(x: Type[int]) -> None: if isinst...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"isinstance(x, Type) not accepted","articleBody":"`isinstance(x, Type)` generates in an error, even though it should probably be considered equivalent to `isinstance(x, type)`. Example:\r\n\r\n```py\r\nfrom typing import Type\r\n\r\ndef f(x: Type[int]) -> None:\r\n    if isinstance(x, Type):  # Argument 2 to \"isinstance\" has incompatible type \"object\"; \r\n                             # expected \"Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]\"\r\n        pass\r\n```","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2017-03-27T09:25:46Z","url":"https://github.com/python/mypy/issues/3060"}

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:7c0d5202-d619-5297-b757-28a602acaf1f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id94C0:77A5A:2D9631B:3C55241:6B002497
html-safe-noncecfd6f5ba4dc434c96296ec85a43b34efa10dbcf7d432ec3f03231bb512314ce8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEMwOjc3QTVBOjJEOTYzMUI6M0M1NTI0MTo2QjAwMjQ5NyIsInZpc2l0b3JfaWQiOiIxMzI5MDE1NjM3OTg0NDIxMDE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac86b387795223bae960de51702b3f501e01560464e1cc43389f8859532465b533
hovercard-subject-tagissue:217185351
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/3060/issue_layout
twitter:imagehttps://opengraph.githubassets.com/da358384cfd228d53287697b910d9e6980a40dc5672aa3e1206ee74e2e37a3dc/python/mypy/issues/3060
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/da358384cfd228d53287697b910d9e6980a40dc5672aa3e1206ee74e2e37a3dc/python/mypy/issues/3060
og:image:altisinstance(x, Type) generates in an error, even though it should probably be considered equivalent to isinstance(x, type). Example: from typing import Type def f(x: Type[int]) -> None: if isinstanc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJukkaL
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/3060#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F3060
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%2F3060
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/3060
Reloadhttps://github.com/python/mypy/issues/3060
Reloadhttps://github.com/python/mypy/issues/3060
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 requests546 (546)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/3060
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/3060
isinstance(x, Type) not acceptedhttps://github.com/python/mypy/issues/3060#top
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
topic-runtime-semanticsmypy doesn't model runtime semantics correctlyhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-runtime-semantics%22
topic-type-narrowingConditional type narrowing / binderhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-narrowing%22
topic-usabilityhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-usability%22
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Mar 27, 2017https://github.com/python/mypy/issues/3060#issue-217185351
Nexthttps://github.com/python/mypy/issues/3060?timeline_page=1
https://github.com/pkch
pkchhttps://github.com/pkch
on Mar 28, 2017https://github.com/python/mypy/issues/3060#issuecomment-289878475
#3070https://github.com/python/mypy/pull/3070
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Mar 28, 2017https://github.com/python/mypy/issues/3060#issuecomment-289930729
#731https://github.com/python/mypy/issues/731
https://github.com/pkch
pkchhttps://github.com/pkch
on Mar 29, 2017https://github.com/python/mypy/issues/3060#issuecomment-289983098
@JukkaLhttps://github.com/JukkaL
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Mar 29, 2017https://github.com/python/mypy/issues/3060#issuecomment-290113792
https://github.com/pkch
pkchhttps://github.com/pkch
on Mar 29, 2017https://github.com/python/mypy/issues/3060#issuecomment-290201636
ilevkivskyihttps://github.com/ilevkivskyi
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
on Jun 15, 2019https://github.com/python/mypy/issues/3060#event-2415153117
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 15, 2019https://github.com/python/mypy/issues/3060#issuecomment-502322595
JukkaLhttps://github.com/JukkaL
topic-usabilityhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-usability%22
on Jun 18, 2019https://github.com/python/mypy/issues/3060#event-2420306118
samuelcolvinhttps://github.com/samuelcolvin
on Sep 16, 2019https://github.com/python/mypy/issues/3060#event-2635772815
Add support for Type[T] typehints when arbitrary_types_allowed==True. (…https://github.com/pydantic/pydantic/commit/f08fd2fee738145efa894199fe47e49a84c96aa1
…https://github.com/pydantic/pydantic/pull/808
f08fd2fhttps://github.com/pydantic/pydantic/commit/f08fd2fee738145efa894199fe47e49a84c96aa1
callahantiffhttps://github.com/callahantiff
on Jul 17, 2020https://github.com/python/mypy/issues/3060#event-3559457280
ignoring mypy _SpecialForm errorhttps://github.com/callahantiff/OMOP2OBO/commit/ff9d43aff8c4c4b094f2b02cf0fdf6777c4855d7
ff9d43ahttps://github.com/callahantiff/OMOP2OBO/commit/ff9d43aff8c4c4b094f2b02cf0fdf6777c4855d7
JelleZijlstrahttps://github.com/JelleZijlstra
topic-type-narrowingConditional type narrowing / binderhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-narrowing%22
on Mar 19, 2022https://github.com/python/mypy/issues/3060#event-6270117778
AlexWaygoodhttps://github.com/AlexWaygood
topic-runtime-semanticsmypy doesn't model runtime semantics correctlyhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-runtime-semantics%22
on Mar 27, 2022https://github.com/python/mypy/issues/3060#event-6314393290
mthuurnehttps://github.com/mthuurne
on Mar 22, 2024https://github.com/python/mypy/issues/3060#event-12219512740
Use `callable()` builtin function over `isinstance(..., Callable)`https://github.com/ProtixIT/django-model-utils/commit/a60d2e06d10d8d5319d17f1c61cb4ec2673415c4
a60d2e0https://github.com/ProtixIT/django-model-utils/commit/a60d2e06d10d8d5319d17f1c61cb4ec2673415c4
bdegrevehttps://github.com/bdegreve
on Jun 29, 2025https://github.com/python/mypy/issues/3060#event-18375724537
Register Map and Sequencehttps://github.com/cocamware/lass/commit/9dade7e36c3491ca3958da3c7050e06988167806
9dade7ehttps://github.com/cocamware/lass/commit/9dade7e36c3491ca3958da3c7050e06988167806
Register Map and Sequencehttps://github.com/cocamware/lass/commit/5d7466742862532d0d292ab2192884d06b39f675
5d74667https://github.com/cocamware/lass/commit/5d7466742862532d0d292ab2192884d06b39f675
Register Map and Sequencehttps://github.com/cocamware/lass/commit/cae1a0abd90281168d35d580867a831f6ef63b9e
cae1a0ahttps://github.com/cocamware/lass/commit/cae1a0abd90281168d35d580867a831f6ef63b9e
Register Map and Sequencehttps://github.com/cocamware/lass/commit/4536d92207a9f7c2be449daac547c414e94644be
4536d92https://github.com/cocamware/lass/commit/4536d92207a9f7c2be449daac547c414e94644be
Register Map and Sequencehttps://github.com/cocamware/lass/commit/fe469fbffd2636884782d63957c52601e012b5d9
fe469fbhttps://github.com/cocamware/lass/commit/fe469fbffd2636884782d63957c52601e012b5d9
Register Map and Sequencehttps://github.com/cocamware/lass/commit/ebfcd28b8cbac47084b5506ea0b00fadf5ddb491
ebfcd28https://github.com/cocamware/lass/commit/ebfcd28b8cbac47084b5506ea0b00fadf5ddb491
Register Map and Sequencehttps://github.com/cocamware/lass/commit/b85963643db99d99be99da7c9ddc562843a5b461
b859636https://github.com/cocamware/lass/commit/b85963643db99d99be99da7c9ddc562843a5b461
Register Map and Sequencehttps://github.com/cocamware/lass/commit/57660b6e2300d28843b93ccf4535806337fe4384
57660b6https://github.com/cocamware/lass/commit/57660b6e2300d28843b93ccf4535806337fe4384
Register Map and Sequencehttps://github.com/cocamware/lass/commit/330ae24818c9f11870cbdb800bf79661fe2459dc
330ae24https://github.com/cocamware/lass/commit/330ae24818c9f11870cbdb800bf79661fe2459dc
Register Map and Sequencehttps://github.com/cocamware/lass/commit/57b1c6b1cb6904c061d87bac0fce7d13603c193e
57b1c6bhttps://github.com/cocamware/lass/commit/57b1c6b1cb6904c061d87bac0fce7d13603c193e
Register Map and Sequencehttps://github.com/cocamware/lass/commit/11e2ffbbcdcda5916fe85438bae506880068c416
11e2ffbhttps://github.com/cocamware/lass/commit/11e2ffbbcdcda5916fe85438bae506880068c416
Register Map and Sequencehttps://github.com/cocamware/lass/commit/7d1ed06669aae5a420c996166237ad6eb434ff18
7d1ed06https://github.com/cocamware/lass/commit/7d1ed06669aae5a420c996166237ad6eb434ff18
Register Map and Sequencehttps://github.com/cocamware/lass/commit/a27eb07bf41ffeef78753148c40c3352ef0c0be7
a27eb07https://github.com/cocamware/lass/commit/a27eb07bf41ffeef78753148c40c3352ef0c0be7
Register Map and Sequencehttps://github.com/cocamware/lass/commit/b19bbae1747d879491c7b0192f5959e6e6658f06
b19bbaehttps://github.com/cocamware/lass/commit/b19bbae1747d879491c7b0192f5959e6e6658f06
Register Map and Sequencehttps://github.com/cocamware/lass/commit/33e0b7f69d175ffe79002c977251df6ab6976519
33e0b7fhttps://github.com/cocamware/lass/commit/33e0b7f69d175ffe79002c977251df6ab6976519
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/3060
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/3060
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
topic-runtime-semanticsmypy doesn't model runtime semantics correctlyhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-runtime-semantics%22
topic-type-narrowingConditional type narrowing / binderhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-narrowing%22
topic-usabilityhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-usability%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.