René's URL Explorer Experiment


Title: Unsafe subtype: datetime/date by m-aciek · Pull Request #20448 · python/mypy · GitHub

Open Graph Title: Unsafe subtype: datetime/date by m-aciek · Pull Request #20448 · python/mypy

X Title: Unsafe subtype: datetime/date by m-aciek · Pull Request #20448 · python/mypy

Description: Fixes #9015. This PR introduces unsafe-subtype error code, which makes mypy check fail for unsafe date and datetime classes inheritance, following @JukkaL's comment in the related issue. Before: fr...

Open Graph Description: Fixes #9015. This PR introduces unsafe-subtype error code, which makes mypy check fail for unsafe date and datetime classes inheritance, following @JukkaL's comment in the related issue. Before...

X Description: Fixes #9015. This PR introduces unsafe-subtype error code, which makes mypy check fail for unsafe date and datetime classes inheritance, following @JukkaL's comment in the related issue. Be...

Opengraph URL: https://github.com/python/mypy/pull/20448

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:f9415f82-5920-8806-cfd7-593fcb205b75
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA3FE:71086:F9A97F:14FEFAD:696EB8BB
html-safe-noncef0256e6daade0b6de6aeb531d7cf65a78a0a016b9c58e7b14262e323145e3102
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0ZFOjcxMDg2OkY5QTk3RjoxNEZFRkFEOjY5NkVCOEJCIiwidmlzaXRvcl9pZCI6IjMxNTAzOTIzMzA2OTcyNTg4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac15ef2f7a6f2527cfa7eaf0e2c3164558bd013f5029f4964673c149f07deb0115
hovercard-subject-tagpull_request:3119268406
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/mypy/20448/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/06a7278e0f71c0d9a9a85d33484b8170e3c7e3e1b03ba877c6211dba2508528a/python/mypy/pull/20448
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/06a7278e0f71c0d9a9a85d33484b8170e3c7e3e1b03ba877c6211dba2508528a/python/mypy/pull/20448
og:image:altFixes #9015. This PR introduces unsafe-subtype error code, which makes mypy check fail for unsafe date and datetime classes inheritance, following @JukkaL's comment in the related issue. Before...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamem-aciek
hostnamegithub.com
expected-hostnamegithub.com
Noneb278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee
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
release39aed5006635ab6f45e6b77d23e73b08a00272a3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/python/mypy/pull/20448#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20448
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20448
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
Reloadhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
Reloadhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
python https://patch-diff.githubusercontent.com/python
mypyhttps://patch-diff.githubusercontent.com/python/mypy
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fmypy
Fork 3.1k https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fmypy
Star 20.1k https://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fmypy
Code https://patch-diff.githubusercontent.com/python/mypy
Issues 2.7k https://patch-diff.githubusercontent.com/python/mypy/issues
Pull requests 426 https://patch-diff.githubusercontent.com/python/mypy/pulls
Actions https://patch-diff.githubusercontent.com/python/mypy/actions
Projects 0 https://patch-diff.githubusercontent.com/python/mypy/projects
Wiki https://patch-diff.githubusercontent.com/python/mypy/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/python/mypy/security
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
Insights https://patch-diff.githubusercontent.com/python/mypy/pulse
Code https://patch-diff.githubusercontent.com/python/mypy
Issues https://patch-diff.githubusercontent.com/python/mypy/issues
Pull requests https://patch-diff.githubusercontent.com/python/mypy/pulls
Actions https://patch-diff.githubusercontent.com/python/mypy/actions
Projects https://patch-diff.githubusercontent.com/python/mypy/projects
Wiki https://patch-diff.githubusercontent.com/python/mypy/wiki
Security https://patch-diff.githubusercontent.com/python/mypy/security
Insights https://patch-diff.githubusercontent.com/python/mypy/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fpython%2Fmypy%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fpython%2Fmypy%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448#issue-comment-box
m-aciekhttps://patch-diff.githubusercontent.com/m-aciek
python:masterhttps://patch-diff.githubusercontent.com/python/mypy/tree/master
m-aciek:unsafe-subtypehttps://patch-diff.githubusercontent.com/m-aciek/mypy/tree/unsafe-subtype
Unsafe subtype: datetime/date https://patch-diff.githubusercontent.com/python/mypy/pull/20448#top
m-aciekhttps://patch-diff.githubusercontent.com/m-aciek
python:masterhttps://patch-diff.githubusercontent.com/python/mypy/tree/master
m-aciek:unsafe-subtypehttps://patch-diff.githubusercontent.com/m-aciek/mypy/tree/unsafe-subtype
Conversation 6 https://patch-diff.githubusercontent.com/python/mypy/pull/20448
Commits 12 https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits
Checks 23 https://patch-diff.githubusercontent.com/python/mypy/pull/20448/checks
Files changed 5 https://patch-diff.githubusercontent.com/python/mypy/pull/20448/files
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/python/mypy/pull/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/m-aciek
m-aciekhttps://patch-diff.githubusercontent.com/m-aciek
Dec 20, 2025https://patch-diff.githubusercontent.com/python/mypy/pull/20448#issue-3749378339
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
#9015https://github.com/python/mypy/issues/9015
@JukkaLhttps://github.com/JukkaL
commenthttps://github.com/python/mypy/issues/9015#issuecomment-646678572
Experiment: revert datetime-date inheritance typeshed#15136https://github.com/python/typeshed/pull/15136
straightforward to addhttps://github.com/m-aciek/mypy/pull/1/changes/2b3e1b36cf522a860c0a55a641b9f3d631fd8513
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
Copilothttps://patch-diff.githubusercontent.com/apps/copilot-swe-agent
December 19, 2025 22:59https://patch-diff.githubusercontent.com/python/mypy/pull/20448#commits-pushed-5a9efed
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
Initial planhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/5a9efed1afc5aa93ccca40b31b33c3a574d3d1da
5a9efedhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/5a9efed1afc5aa93ccca40b31b33c3a574d3d1da
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Implement unsafe subtype checking for datetime/date comparisonshttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/126ffab3ebf5030b3cdf03b43e91ec97d5dfb780
126ffabhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/126ffab3ebf5030b3cdf03b43e91ec97d5dfb780
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Fix docstring indentation and line continuation stylehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/7ff17b259766f433ac0a88d9da29ae6f0de86a11
7ff17b2https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/7ff17b259766f433ac0a88d9da29ae6f0de86a11
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Flag date vs date comparisons as unsafe when datetime subclass existshttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/857f0fad7fcc20f94e88070a112b7e7b3e3c160a
857f0fahttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/857f0fad7fcc20f94e88070a112b7e7b3e3c160a
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Add detailed documentation for supertype comparison checkinghttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/ffc35922d40c0ad564bef1be0f7e1acc89d79512
ffc3592https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/ffc35922d40c0ad564bef1be0f7e1acc89d79512
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Block datetime/date inheritance when unsafe-subtype is enabledhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/901cdecdcb9d132db86f5dbe42511fdc59614a36
901cdechttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/901cdecdcb9d132db86f5dbe42511fdc59614a36
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Move errorcodes import to module level for performancehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/cb83a2a616834295d3ac564d0f094a9ab3c927d6
cb83a2ahttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/cb83a2a616834295d3ac564d0f094a9ab3c927d6
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Remove date/date comparison warnings as inheritance blocking makes th…https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/1b55f52dd64a1315e549df1e271894d33ee1611e
1b55f52https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/1b55f52dd64a1315e549df1e271894d33ee1611e
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Remove redundant comparison check code in visit_comparison_exprhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/2d231f578623950fd915bde6b3a6259d81236da3
2d231f5https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/2d231f578623950fd915bde6b3a6259d81236da3
https://patch-diff.githubusercontent.com/apps/copilot-swe-agent
https://patch-diff.githubusercontent.com/m-aciek
Add documentation for unsafe-subtype error codehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/5ee1d68d289f4ea7558e02627533bd5c56eab802
5ee1d68https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/5ee1d68d289f4ea7558e02627533bd5c56eab802
https://patch-diff.githubusercontent.com/marketplace/pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hookshttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/427f31cac0a10901a776e7f0534b929c9323a6b6
427f31chttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/427f31cac0a10901a776e7f0534b929c9323a6b6
https://pre-commit.cihttps://pre-commit.ci
https://patch-diff.githubusercontent.com/m-aciek
m-aciekhttps://patch-diff.githubusercontent.com/m-aciek
Dec 20, 2025 https://patch-diff.githubusercontent.com/python/mypy/pull/20448#ref-issue-3424996412
Path to integrate DateType into the standard library glyph/DateType#16 https://patch-diff.githubusercontent.com/glyph/DateType/issues/16
https://patch-diff.githubusercontent.com/apps/github-actions
Sign in to viewhttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20448
https://patch-diff.githubusercontent.com/sterliakov
sterliakovhttps://patch-diff.githubusercontent.com/sterliakov
Dec 25, 2025 https://patch-diff.githubusercontent.com/python/mypy/pull/20448#pullrequestreview-3611678467
View reviewed changes https://patch-diff.githubusercontent.com/python/mypy/pull/20448/files/427f31cac0a10901a776e7f0534b929c9323a6b6
sterliakovhttps://patch-diff.githubusercontent.com/sterliakov
https://patch-diff.githubusercontent.com/python/mypy/pull/20448#pullrequestreview-3611678467
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
mypy/subtypes.pyhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/files/427f31cac0a10901a776e7f0534b929c9323a6b6#diff-3641fc675bdf772ec816dbb1b8ef258e9f07c15f604d83d7549bf7b873757a54
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
mypy/subtypes.pyhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/files/427f31cac0a10901a776e7f0534b929c9323a6b6#diff-3641fc675bdf772ec816dbb1b8ef258e9f07c15f604d83d7549bf7b873757a54
sterliakovhttps://patch-diff.githubusercontent.com/sterliakov
Dec 24, 2025https://patch-diff.githubusercontent.com/python/mypy/pull/20448#discussion_r2646363161
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
https://patch-diff.githubusercontent.com/m-aciek
m-aciekhttps://patch-diff.githubusercontent.com/m-aciek
Dec 25, 2025https://patch-diff.githubusercontent.com/python/mypy/pull/20448#issuecomment-3691823913
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
@JukkaLhttps://github.com/JukkaL
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
https://patch-diff.githubusercontent.com/m-aciek
https://patch-diff.githubusercontent.com/sterliakov
Remove superfluous iterationhttps://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/089e95208462e03ac766bb900d7ea96aac7a1a15
089e952https://patch-diff.githubusercontent.com/python/mypy/pull/20448/commits/089e95208462e03ac766bb900d7ea96aac7a1a15
https://patch-diff.githubusercontent.com/apps/github-actions
github-actionshttps://patch-diff.githubusercontent.com/apps/github-actions
Dec 26, 2025https://patch-diff.githubusercontent.com/python/mypy/pull/20448#issuecomment-3693461703
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20448
https://patch-diff.githubusercontent.com/sterliakov
sterliakov https://patch-diff.githubusercontent.com/sterliakov
https://patch-diff.githubusercontent.com/python/mypy/pull/20448/files/427f31cac0a10901a776e7f0534b929c9323a6b6
datetimes and dates are not substitutable but mypy thinks they are https://github.com/python/mypy/issues/9015
Please reload this pagehttps://patch-diff.githubusercontent.com/python/mypy/pull/20448
https://patch-diff.githubusercontent.com/m-aciek
https://patch-diff.githubusercontent.com/sterliakov
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.