René's URL Explorer Experiment


Title: Honor return type of `__new__` · Issue #1020 · python/mypy · GitHub

Open Graph Title: Honor return type of `__new__` · Issue #1020 · python/mypy

X Title: Honor return type of `__new__` · Issue #1020 · python/mypy

Description: Currently the return type of A(...) is implicitly A even if A.__new__ return something else. If the return type is Any, maybe A(...) should have type Any, and if it's a subclass, we should also use that. Currently this is a little diffic...

Open Graph Description: Currently the return type of A(...) is implicitly A even if A.__new__ return something else. If the return type is Any, maybe A(...) should have type Any, and if it's a subclass, we should also use...

X Description: Currently the return type of A(...) is implicitly A even if A.__new__ return something else. If the return type is Any, maybe A(...) should have type Any, and if it's a subclass, we should also...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Honor return type of `__new__`","articleBody":"Currently the return type of `A(...)` is implicitly `A` even if `A.__new__` return something else. If the return type is `Any`, maybe `A(...)` should have type `Any`, and if it's a subclass, we should also use that. Currently this is a little difficult to implement due to implementation limitations (we derive the type object identity from the return type of a type object). Maybe we should introduce a new attribute to `Callable` for this purpose.\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2015-11-29T20:39:10Z","url":"https://github.com/python/mypy/issues/1020"}

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:8f43f794-a4cd-e86e-f6f6-abb5a82b8edd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9874:1BEF18:1FE4CDD:2B17829:6B001922
html-safe-nonce246a08bf566b37f564f27232c591f91919dcc071f25053481efd7dd0322892eb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODc0OjFCRUYxODoxRkU0Q0REOjJCMTc4Mjk6NkIwMDE5MjIiLCJ2aXNpdG9yX2lkIjoiNTU0NDk5MTA5ODA2NzIyODk2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9e3ca7ed8beabb987a8154aabb1d9aed034d062fff5d85d1e73937dbcdbe6415
hovercard-subject-tagissue:119386509
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/1020/issue_layout
twitter:imagehttps://opengraph.githubassets.com/da3956b229de9edc84a56481ad244bb29b033fd0c503d537dc5ddc7637017366/python/mypy/issues/1020
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/da3956b229de9edc84a56481ad244bb29b033fd0c503d537dc5ddc7637017366/python/mypy/issues/1020
og:image:altCurrently the return type of A(...) is implicitly A even if A.__new__ return something else. If the return type is Any, maybe A(...) should have type Any, and if it's a subclass, we should also use...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJukkaL
hostnamegithub.com
expected-hostnamegithub.com
Nonea2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4
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
release70121d4e855ee0bb7b75cf15d061d91f8863c0f8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/1020#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F1020
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%2F1020
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/1020
Reloadhttps://github.com/python/mypy/issues/1020
Reloadhttps://github.com/python/mypy/issues/1020
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/1020
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/1020
#7188https://github.com/python/mypy/pull/7188
Honor return type of __new__https://github.com/python/mypy/issues/1020#top
#7188https://github.com/python/mypy/pull/7188
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Nov 29, 2015https://github.com/python/mypy/issues/1020#issue-119386509
Nexthttps://github.com/python/mypy/issues/1020?timeline_page=1
JukkaLhttps://github.com/JukkaL
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
on Nov 29, 2015https://github.com/python/mypy/issues/1020#event-477175978
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Nov 29, 2015https://github.com/python/mypy/issues/1020#issuecomment-160468540
#982https://github.com/python/mypy/issues/982
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Nov 29, 2015https://github.com/python/mypy/issues/1020#issuecomment-160483147
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Nov 30, 2015https://github.com/python/mypy/issues/1020#issuecomment-160490885
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Nov 30, 2015https://github.com/python/mypy/issues/1020#issuecomment-160510794
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Oct 13, 2016https://github.com/python/mypy/issues/1020#issuecomment-253475548
@JukkaLhttps://github.com/JukkaL
gvanrossumhttps://github.com/gvanrossum
on Oct 13, 2016https://github.com/python/mypy/issues/1020#event-822938318
gvanrossumhttps://github.com/gvanrossum
priority-2-lowhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-2-low%22
on Jan 6, 2017https://github.com/python/mypy/issues/1020#event-914699313
gvanrossumhttps://github.com/gvanrossum
on Mar 29, 2017https://github.com/python/mypy/issues/1020#event-1021274346
https://github.com/davidroeca
davidroecahttps://github.com/davidroeca
on Apr 26, 2017https://github.com/python/mypy/issues/1020#issuecomment-297440155
python/typing#415https://github.com/python/typing/issues/415
#3062https://github.com/python/mypy/issues/3062
https://github.com/chadrik
chadrikhttps://github.com/chadrik
on Dec 3, 2017https://github.com/python/mypy/issues/1020#issuecomment-348829847
#3307https://github.com/python/mypy/issues/3307
https://github.com/nierob
nierobhttps://github.com/nierob
on Apr 6, 2018https://github.com/python/mypy/issues/1020#issuecomment-379204926
JukkaLhttps://github.com/JukkaL
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
priority-2-lowhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-2-low%22
on May 18, 2018https://github.com/python/mypy/issues/1020#event-1635063157
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Mar 29, 2022https://github.com/python/mypy/issues/1020#issuecomment-1081401853
https://github.com/moi90
moi90https://github.com/moi90
on Mar 31, 2022https://github.com/python/mypy/issues/1020#issuecomment-1084237584
https://github.com/twoertwein
twoertweinhttps://github.com/twoertwein
on Oct 1, 2022https://github.com/python/mypy/issues/1020#issuecomment-1264354265
https://github.com/sdeframond
sdeframondhttps://github.com/sdeframond
on Nov 17, 2022https://github.com/python/mypy/issues/1020#issuecomment-1318657466
https://github.com/oscarbenjamin
oscarbenjaminhttps://github.com/oscarbenjamin
on May 4, 2023https://github.com/python/mypy/issues/1020#issuecomment-1534720141
sympy/sympy#25103https://github.com/sympy/sympy/pull/25103
https://github.com/nickdrozd
nickdrozdhttps://github.com/nickdrozd
on Sep 1, 2023https://github.com/python/mypy/issues/1020#issuecomment-1703221367
hauntsaninjahttps://github.com/hauntsaninja
on Sep 2, 2023https://github.com/python/mypy/issues/1020#event-10263616883
Believe arbitrary __new__ return typeshttps://github.com/hauntsaninja/mypy/commit/4616fa23246d28f435d1abb269670702ebf755b9
4616fa2https://github.com/hauntsaninja/mypy/commit/4616fa23246d28f435d1abb269670702ebf755b9
https://github.com/zmievsa
zmievsahttps://github.com/zmievsa
on Sep 24, 2023https://github.com/python/mypy/issues/1020#issuecomment-1732522894
cached_classpropertyhttps://github.com/Ovsyanka83/cached_classproperty
https://github.com/Booplicate
Booplicatehttps://github.com/Booplicate
on Nov 24, 2023https://github.com/python/mypy/issues/1020#issuecomment-1825483945
https://github.com/oscarbenjamin
oscarbenjaminhttps://github.com/oscarbenjamin
on Nov 24, 2023https://github.com/python/mypy/issues/1020#issuecomment-1825771327
https://docs.python.org/3/reference/datamodel.html#object.__newhttps://docs.python.org/3/reference/datamodel.html#object.__new
mypy/mypy/checker.pyhttps://github.com/python/mypy/blob/5b1a231425ac807b7118aac6a68b633949412a36/mypy/checker.py#L1535-L1543
5b1a231https://github.com/python/mypy/commit/5b1a231425ac807b7118aac6a68b633949412a36
mypy/mypy/checkmember.pyhttps://github.com/python/mypy/blob/5b1a231425ac807b7118aac6a68b633949412a36/mypy/checkmember.py#L1244-L1312
5b1a231https://github.com/python/mypy/commit/5b1a231425ac807b7118aac6a68b633949412a36
https://github.com/Booplicate
Booplicatehttps://github.com/Booplicate
on Nov 24, 2023https://github.com/python/mypy/issues/1020#issuecomment-1825940464
https://private-user-images.githubusercontent.com/53382877/285511733-6010841e-9aec-40f3-b2dc-6c398d3b0064.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUxNjg4NDYsIm5iZiI6MTc5NTE2ODU0NiwicGF0aCI6Ii81MzM4Mjg3Ny8yODU1MTE3MzMtNjAxMDg0MWUtOWFlYy00MGYzLWIyZGMtNmMzOThkM2IwMDY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIwVDA5NTU0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5YWUxOWU1N2UzMDA2M2I5OGRlMjcxYjhhOTNmNjM4NWNmNjg3ZjE5YTkwNWMzY2U2NDkzMzIyMGZmNTZjNjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.mFIHPpkrlvLH-Yfg5olkanBPBoeqlWmJRH0bsIfeS5Q
https://private-user-images.githubusercontent.com/53382877/285512170-acd078c5-db14-4ccc-874f-750e3a538160.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUxNjg4NDYsIm5iZiI6MTc5NTE2ODU0NiwicGF0aCI6Ii81MzM4Mjg3Ny8yODU1MTIxNzAtYWNkMDc4YzUtZGIxNC00Y2NjLTg3NGYtNzUwZTNhNTM4MTYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIwVDA5NTU0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0Njc1OTZiNWJhOGM3ZjVhYjI3MjcyODU5ZDMxM2FjMTQyYTY5Y2Q2NTVmMjkzZTRhYmIzZjUyNjM4ZGVlMzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.tLPz8p-motTIaSWEMHRyzjOX39CoXqq2VW-kca_SxOs
https://github.com/oscarbenjamin
oscarbenjaminhttps://github.com/oscarbenjamin
on Nov 24, 2023https://github.com/python/mypy/issues/1020#issuecomment-1825988695
https://github.com/nickdrozd
nickdrozdhttps://github.com/nickdrozd
on Nov 29, 2023https://github.com/python/mypy/issues/1020#issuecomment-1832447139
@oscarbenjaminhttps://github.com/oscarbenjamin
https://github.com/johnfn
johnfnhttps://github.com/johnfn
on Feb 28, 2025https://github.com/python/mypy/issues/1020#issuecomment-2691510349
https://github.com/oscarbenjamin
oscarbenjaminhttps://github.com/oscarbenjamin
on Feb 28, 2025https://github.com/python/mypy/issues/1020#issuecomment-2691553698
gh-15182https://github.com/python/mypy/issues/15182
typing spechttps://typing.readthedocs.io/en/latest/spec/constructors.html
gh-15182https://github.com/python/mypy/issues/15182
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/1020
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/1020
false-positivemypy gave an error on correct codehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22false-positive%22
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%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.