René's URL Explorer Experiment


Title: What to do when the runtime lies? · Issue #11141 · python/typeshed · GitHub

Open Graph Title: What to do when the runtime lies? · Issue #11141 · python/typeshed

X Title: What to do when the runtime lies? · Issue #11141 · python/typeshed

Description: I've been cleaning up inheritance mismatches. I've found that several modules with a C implementation fudge the module name of their classes. For example: ReferenceType is a class defined in the _weakref C implementation, and then import...

Open Graph Description: I've been cleaning up inheritance mismatches. I've found that several modules with a C implementation fudge the module name of their classes. For example: ReferenceType is a class defined in the _w...

X Description: I've been cleaning up inheritance mismatches. I've found that several modules with a C implementation fudge the module name of their classes. For example: ReferenceType is a class defined i...

Opengraph URL: https://github.com/python/typeshed/issues/11141

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"What to do when the runtime lies?","articleBody":"I've been cleaning up inheritance mismatches. I've found that several modules with a C implementation fudge the module name of their classes. For example:\r\n\r\n`ReferenceType` is a class defined in the `_weakref` C implementation, and then imported from there into the `weakref` module. Because it's a C implementation, it's free to declare it's own qualified name, and calls itself `weakref.ReferenceType`: https://github.com/python/cpython/blob/main/Objects/weakrefobject.c#L368C1-L368C1\r\n\r\nThe intention, I believe, being that this class canonically lives in the `weakref` module, and the fact that it's being defined in `_weakref` is an implementation detail which is hidden at runtime. Typeshed declares the class in `_weakref.pyi`, which means it gets a qualified name of `_weakref.ReferenceType`\r\n\r\nI can see two possible arguments:\r\n\r\n - Typeshed should continue to follow the layout of implementation over the declared implementation. e.g. `ReferenceType` is defined in `_weakref` originally, so that's the correct place for it.\r\n\r\nOR \r\n\r\n - Typeshed should follow the declared implementation over the layout. e.g. `ReferenceType` considers itself to live in the `weakref` module, that's where the majority of users will get it from, so that's the correct place for it.\r\n\r\n\r\nThis pattern pops up in a lot of places: in `_ast`, `_decimal`, and `_sqlite3` are some of the others I've noticed. I suspect the current state of typeshed is inconsistent on this issue, since not all modules that have a C implementation currently have  a `_foo.pyi` stub file. \r\n\r\nIs there a consensus among typeshed's maintainers here? I'm a little biased towards option 2 at the moment, since I'm trying to make as many inheritances match as I can, but I think there's a good argument for either side, and this is, in the end, a very minor issue with not much practical effect.","author":{"url":"https://github.com/tungol","@type":"Person","name":"tungol"},"datePublished":"2023-12-10T21:09:56Z","url":"https://github.com/python/typeshed/issues/11141"}

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:04b69448-f7c9-e799-c26c-94d1adef32c9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBBDE:22FAD4:7A01B4:A29E00:6B003ABB
html-safe-nonced5e1012f123a71b1f57886f096cb2fadd7a484852176ea47fe5b3390a7a7dcca
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkRFOjIyRkFENDo3QTAxQjQ6QTI5RTAwOjZCMDAzQUJCIiwidmlzaXRvcl9pZCI6IjcyNjExMTAxNzgxMzk4ODAxMjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7a41343e020c01932b78a36242394d5256a22ce695d157387648ebd3cdd80f25
hovercard-subject-tagissue:2034534885
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/typeshed/11141/issue_layout
twitter:imagehttps://opengraph.githubassets.com/75fbdd38c4a5792ad97e7d4a0d184ce168945358517b6351466825a185487f7a/python/typeshed/issues/11141
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/75fbdd38c4a5792ad97e7d4a0d184ce168945358517b6351466825a185487f7a/python/typeshed/issues/11141
og:image:altI've been cleaning up inheritance mismatches. I've found that several modules with a C implementation fudge the module name of their classes. For example: ReferenceType is a class defined in the _w...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametungol
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/python/typeshed git https://github.com/python/typeshed.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id31696383
octolytics-dimension-repository_nwopython/typeshed
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31696383
octolytics-dimension-repository_network_root_nwopython/typeshed
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/typeshed/issues/11141#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F11141
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%2Ftypeshed%2Fissues%2F11141
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%2Ftypeshed
Reloadhttps://github.com/python/typeshed/issues/11141
Reloadhttps://github.com/python/typeshed/issues/11141
Reloadhttps://github.com/python/typeshed/issues/11141
pythonhttps://github.com/python
typeshedhttps://github.com/python/typeshed
Codehttps://github.com/python/typeshed
Issues196 (196)https://github.com/python/typeshed/issues
Pull requests252 (252)https://github.com/python/typeshed/pulls
Actionshttps://github.com/python/typeshed/actions
Security and qualityhttps://github.com/python/typeshed/security
Insightshttps://github.com/python/typeshed/insights
https://github.com/python/typeshed
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/11141
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/11141
What to do when the runtime lies?https://github.com/python/typeshed/issues/11141#top
project: policyOrganization of the typeshed projecthttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22project%3A%20policy%22
https://github.com/tungol
tungolhttps://github.com/tungol
on Dec 10, 2023https://github.com/python/typeshed/issues/11141#issue-2034534885
https://github.com/python/cpython/blob/main/Objects/weakrefobject.c#L368C1-L368C1https://github.com/python/cpython/blob/main/Objects/weakrefobject.c#L368C1-L368C1
https://github.com/srittau
srittauhttps://github.com/srittau
on Dec 11, 2023https://github.com/python/typeshed/issues/11141#issuecomment-1850121255
https://github.com/tungol
tungolhttps://github.com/tungol
on Dec 11, 2023https://github.com/python/typeshed/issues/11141#issuecomment-1850629557
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Dec 13, 2023https://github.com/python/typeshed/issues/11141#issuecomment-1853060748
#3968https://github.com/python/typeshed/issues/3968
python/mypy@master...hauntsaninja:mypy:stubtestbaseclass#diff-55639a1f38efeacbb10988649399037c13ad11e9c82890b453d98ea2bed9caf8R267https://github.com/python/mypy/compare/master...hauntsaninja:mypy:stubtestbaseclass#diff-55639a1f38efeacbb10988649399037c13ad11e9c82890b453d98ea2bed9caf8R267
tungolhttps://github.com/tungol
on Dec 14, 2023https://github.com/python/typeshed/issues/11141#event-11242639375
resort _ast and ast moduleshttps://github.com/tungol/typeshed/commit/bcda742d9d6afedb66d9c38ba2e1a413e772c6d7
bcda742https://github.com/tungol/typeshed/commit/bcda742d9d6afedb66d9c38ba2e1a413e772c6d7
resort _ast and ast moduleshttps://github.com/tungol/typeshed/commit/6bfaa479ed4e4f01966722b12c6d30b49d9ae7b2
6bfaa47https://github.com/tungol/typeshed/commit/6bfaa479ed4e4f01966722b12c6d30b49d9ae7b2
resort weakref classeshttps://github.com/tungol/typeshed/commit/87900ff34729c25b1a29c4861c2f7c9c8b1ba40a
87900ffhttps://github.com/tungol/typeshed/commit/87900ff34729c25b1a29c4861c2f7c9c8b1ba40a
move pyexpat.ExpatError to xml.parsers.expat.ExpatErrorhttps://github.com/tungol/typeshed/commit/2cd76046cff30a7f3d9d32d4ed914a8467bd074c
2cd7604https://github.com/tungol/typeshed/commit/2cd76046cff30a7f3d9d32d4ed914a8467bd074c
move pyexpat.ExpatError to xml.parsers.expat.ExpatErrorhttps://github.com/tungol/typeshed/commit/344673f4872ae613288e18c3188cfd9a76f20882
344673fhttps://github.com/tungol/typeshed/commit/344673f4872ae613288e18c3188cfd9a76f20882
add _sqlite3 modulehttps://github.com/tungol/typeshed/commit/ccd4d9a21452ea96140aef4455f71e5081af7a85
ccd4d9ahttps://github.com/tungol/typeshed/commit/ccd4d9a21452ea96140aef4455f71e5081af7a85
https://github.com/tungol
tungolhttps://github.com/tungol
on Dec 17, 2023https://github.com/python/typeshed/issues/11141#issuecomment-1858992564
https://github.com/python/cpython/blob/d91e43ed7839b601cbeadd137d89e69e2cc3efda/Lib/_pydecimal.py#L151https://github.com/python/cpython/blob/d91e43ed7839b601cbeadd137d89e69e2cc3efda/Lib/_pydecimal.py#L151
srittauhttps://github.com/srittau
project: policyOrganization of the typeshed projecthttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22project%3A%20policy%22
on Dec 18, 2023https://github.com/python/typeshed/issues/11141#event-11276288151
https://github.com/tungol
tungolhttps://github.com/tungol
on Dec 22, 2023https://github.com/python/typeshed/issues/11141#issuecomment-1867077967
python/mypy#16698https://github.com/python/mypy/pull/16698
https://github.com/Akuli
Akulihttps://github.com/Akuli
on Jan 3, 2024https://github.com/python/typeshed/issues/11141#issuecomment-1875080005
#11187https://github.com/python/typeshed/pull/11187
#11155https://github.com/python/typeshed/pull/11155
#11159https://github.com/python/typeshed/pull/11159
#11174https://github.com/python/typeshed/pull/11174
https://github.com/tungol
tungolhttps://github.com/tungol
on Jan 3, 2024https://github.com/python/typeshed/issues/11141#issuecomment-1875809327
#6257https://github.com/python/typeshed/issues/6257
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 2, 2024https://github.com/python/typeshed/issues/11141#issuecomment-2387465050
@hauntsaninjahttps://github.com/hauntsaninja
JelleZijlstrahttps://github.com/JelleZijlstra
completedhttps://github.com/python/typeshed/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 2, 2024https://github.com/python/typeshed/issues/11141#event-14481606046
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 2, 2024https://github.com/python/typeshed/issues/11141#event-14481679862
move pyexpat.ExpatError to xml.parsers.expat.ExpatError (#11168)https://github.com/python/typeshed/commit/ddb57608fdfbbea3e7caf4d7a04934964ab6e5c8
#11168https://github.com/python/typeshed/pull/11168
ddb5760https://github.com/python/typeshed/commit/ddb57608fdfbbea3e7caf4d7a04934964ab6e5c8
resort weakref classes (#11165)https://github.com/python/typeshed/commit/c43894568f0f831dca20e0209df80a963c078be2
#11165https://github.com/python/typeshed/pull/11165
c438945https://github.com/python/typeshed/commit/c43894568f0f831dca20e0209df80a963c078be2
add _sqlite3 module (#11174)https://github.com/python/typeshed/commit/39650b43b5af9b1d1ecf6b325526b23e1df8b4de
#11174https://github.com/python/typeshed/pull/11174
39650b4https://github.com/python/typeshed/commit/39650b43b5af9b1d1ecf6b325526b23e1df8b4de
resort _ast and ast modules (#11162)https://github.com/python/typeshed/commit/77510ae6a48571256bf7b43960ff4fcb02052d77
#11162https://github.com/python/typeshed/pull/11162
77510aehttps://github.com/python/typeshed/commit/77510ae6a48571256bf7b43960ff4fcb02052d77
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typeshed/issues/11141
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typeshed/issues/11141
project: policyOrganization of the typeshed projecthttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22project%3A%20policy%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.