René's URL Explorer Experiment


Title: `isinstance` on `runtime_checkable` `Protocol` has side-effects for `@property` methods · Issue #102433 · python/cpython · GitHub

Open Graph Title: `isinstance` on `runtime_checkable` `Protocol` has side-effects for `@property` methods · Issue #102433 · python/cpython

X Title: `isinstance` on `runtime_checkable` `Protocol` has side-effects for `@property` methods · Issue #102433 · python/cpython

Description: For example: from typing import Protocol, runtime_checkable @runtime_checkable class X(Protocol): @property def myproperty(self): ... class Y: @property def myproperty(self): raise RuntimeError("hallo") isinstance(Y(), X) will raise the ...

Open Graph Description: For example: from typing import Protocol, runtime_checkable @runtime_checkable class X(Protocol): @property def myproperty(self): ... class Y: @property def myproperty(self): raise RuntimeError("ha...

X Description: For example: from typing import Protocol, runtime_checkable @runtime_checkable class X(Protocol): @property def myproperty(self): ... class Y: @property def myproperty(self): raise RuntimeError(&qu...

Opengraph URL: https://github.com/python/cpython/issues/102433

X: @github

direct link

Domain: togithub.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`isinstance` on `runtime_checkable` `Protocol` has side-effects for `@property` methods","articleBody":"For example:\r\n\r\n```python\r\nfrom typing import Protocol, runtime_checkable\r\n\r\n@runtime_checkable\r\nclass X(Protocol):\r\n   @property\r\n   def myproperty(self): ...\r\n\r\nclass Y:\r\n   @property\r\n   def myproperty(self):\r\n      raise RuntimeError(\"hallo\")\r\n\r\nisinstance(Y(), X)\r\n```\r\n\r\nwill raise the `RuntimeError`\r\n\r\nThis is an issue, for example, if `myproperty` is an expensive call, has unwanted side effects, or excepts outside of a context manager\r\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-102449\n* gh-102592\n* gh-102593\n* gh-103034\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/chrisjsewell","@type":"Person","name":"chrisjsewell"},"datePublished":"2023-03-05T03:46:05Z","url":"https://github.com/python/cpython/issues/102433"}

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:e3799242-da26-a03f-6c6c-8b6cc0276bdd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB56A:153A9C:905F24:CC5D35:6AFE1E19
html-safe-nonceabd7b6d550c518e27079b961639a6746d03c3b4b02b27c0c863a2eddb2805143
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTZBOjE1M0E5Qzo5MDVGMjQ6Q0M1RDM1OjZBRkUxRTE5IiwidmlzaXRvcl9pZCI6IjYxMjg3NDAwMTQ3MzQ4NDM0MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacdd4d584198cc122a29c71cfe94726988b2d07cc95c58a366f6426bec956dd165
hovercard-subject-tagissue:1610043426
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/cpython/102433/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a3ac807c4877d37f64c66b4fa6aa9daf27a4dac74cf330ad2b2596998668211f/python/cpython/issues/102433
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a3ac807c4877d37f64c66b4fa6aa9daf27a4dac74cf330ad2b2596998668211f/python/cpython/issues/102433
og:image:altFor example: from typing import Protocol, runtime_checkable @runtime_checkable class X(Protocol): @property def myproperty(self): ... class Y: @property def myproperty(self): raise RuntimeError("ha...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechrisjsewell
hostnamegithub.com
expected-hostnamegithub.com
Noned0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
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
releasefef3993a71fa20f7be8e167132fbf9619bc66e12
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://togithub.com/python/cpython/issues/102433#start-of-content
https://togithub.com/
Sign inhttps://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F102433
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://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F102433
Sign uphttps://togithub.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%2Fcpython
Reloadhttps://togithub.com/python/cpython/issues/102433
Reloadhttps://togithub.com/python/cpython/issues/102433
Reloadhttps://togithub.com/python/cpython/issues/102433
pythonhttps://togithub.com/python
cpythonhttps://togithub.com/python/cpython
Codehttps://togithub.com/python/cpython
Issues5k+ (5k+)https://togithub.com/python/cpython/issues
Pull requests2.4k (2.4k)https://togithub.com/python/cpython/pulls
Actionshttps://togithub.com/python/cpython/actions
Projectshttps://togithub.com/python/cpython/projects
Security and qualityhttps://togithub.com/python/cpython/security
Insightshttps://togithub.com/python/cpython/insights
https://togithub.com/python/cpython
New issuehttps://togithub.com/login?return_to=https://github.com/python/cpython/issues/102433
New issuehttps://togithub.com/login?return_to=https://github.com/python/cpython/issues/102433
isinstance on runtime_checkable Protocol has side-effects for @property methodshttps://togithub.com/python/cpython/issues/102433#top
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
https://github.com/chrisjsewell
chrisjsewellhttps://github.com/chrisjsewell
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issue-1610043426
gh-102433: Add tests for how classes with properties interact with isinstance() checks on typing.runtime_checkable protocols #102449https://github.com/python/cpython/pull/102449
[3.11] gh-102433: Add tests for how classes with properties interact with isinstance() checks on typing.runtime_checkable protocols (GH-102449) #102592https://github.com/python/cpython/pull/102592
[3.10] gh-102433: Add tests for how classes with properties interact with isinstance() checks on typing.runtime_checkable protocols (GH-102449) #102593https://github.com/python/cpython/pull/102593
gh-102433: Use inspect.getattr_static in typing._ProtocolMeta.__instancecheck__ #103034https://github.com/python/cpython/pull/103034
Nexthttps://togithub.com/python/cpython/issues/102433?timeline_page=1
chrisjsewellhttps://togithub.com/chrisjsewell
on Mar 5, 2023https://github.com/python/cpython/issues/102433#event-8667275772
JelleZijlstrahttps://togithub.com/JelleZijlstra
python/typinghttps://github.com/python/typing
on Mar 5, 2023https://github.com/python/cpython/issues/102433#event-8667275775
JelleZijlstrahttps://togithub.com/JelleZijlstra
topic-typinghttps://togithub.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
on Mar 5, 2023https://github.com/python/cpython/issues/102433#event-8667275962
https://togithub.com/chrisjsewell
chrisjsewellhttps://togithub.com/chrisjsewell
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1454981738
https://stackoverflow.com/questions/66641191/rationale-of-instancecheck-on-protocolshttps://stackoverflow.com/questions/66641191/rationale-of-instancecheck-on-protocols
https://togithub.com/JosephSBoyle
JosephSBoylehttps://togithub.com/JosephSBoyle
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455071395
@chrisjsewellhttps://github.com/chrisjsewell
https://togithub.com/chrisjsewell
chrisjsewellhttps://togithub.com/chrisjsewell
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455079703
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455090467
@JosephSBoylehttps://github.com/JosephSBoyle
inspect.getattr_statichttps://docs.python.org/3/library/inspect.html#fetching-attributes-statically
https://togithub.com/JosephSBoyle
JosephSBoylehttps://togithub.com/JosephSBoyle
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455099159
@AlexWaygoodhttps://github.com/AlexWaygood
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455103900
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455106070
https://togithub.com/chrisjsewell
chrisjsewellhttps://togithub.com/chrisjsewell
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455106838
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455107999
https://togithub.com/JosephSBoyle
JosephSBoylehttps://togithub.com/JosephSBoyle
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455108685
@AlexWaygoodhttps://github.com/AlexWaygood
@chrisjsewellhttps://github.com/chrisjsewell
https://togithub.com/chrisjsewell
chrisjsewellhttps://togithub.com/chrisjsewell
on Mar 5, 2023https://github.com/python/cpython/issues/102433#issuecomment-1455116495
miss-islingtonhttps://togithub.com/miss-islington
on Mar 5, 2023https://github.com/python/cpython/issues/102433#event-8668132909
Fix unused classes in a typing test (GH-102437)https://github.com/python/cpython/commit/7894bbe94ba319eb650f383cb5196424c77b2cfd
GH-102437https://github.com/python/cpython/pull/102437
7894bbehttps://github.com/python/cpython/commit/7894bbe94ba319eb650f383cb5196424c77b2cfd
hugovkhttps://togithub.com/hugovk
on Mar 6, 2023https://github.com/python/cpython/issues/102433#event-8673950313
Fix unused classes in a typing test (pythonGH-102437)https://github.com/hugovk/cpython/commit/5075047e5d144017ad8dfb82286a3bb00c4dd9d8
pythonGH-102437https://github.com/python/cpython/pull/102437
5075047https://github.com/hugovk/cpython/commit/5075047e5d144017ad8dfb82286a3bb00c4dd9d8
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
on Mar 6, 2023https://github.com/python/cpython/issues/102433#issuecomment-1456354387
How should isinstance() work at runtime when comparing classes with properties against runtime-checkable protocols? typing#1363https://github.com/python/typing/issues/1363
git-x-moduleshttps://togithub.com/apps/git-x-modules
on Mar 9, 2023https://github.com/python/cpython/issues/102433#event-8711382295
Fix unused classes in a typing test (GH-102437)https://github.com/Lamparter/Fluid.Runtime.Library/commit/364a90ce3721c432c20f2a7e010f2d6f17e349a2
364a90chttps://github.com/Lamparter/Fluid.Runtime.Library/commit/364a90ce3721c432c20f2a7e010f2d6f17e349a2
AlexWaygoodhttps://togithub.com/AlexWaygood
on Mar 11, 2023https://github.com/python/cpython/issues/102433#event-8723139383
gh-102433: Add tests for how classes with properties interact with `i…https://github.com/python/cpython/commit/5ffdaf748d98da6065158534720f1996a45a0072
gh-102433https://github.com/python/cpython/issues/102433
5ffdaf7https://github.com/python/cpython/commit/5ffdaf748d98da6065158534720f1996a45a0072
miss-islingtonhttps://togithub.com/miss-islington
on Mar 11, 2023https://github.com/python/cpython/issues/102433#event-8723140034
pythongh-102433: Add tests for how classes with properties interact w…https://github.com/miss-islington/cpython/commit/6c776976a819a91060dee397a0b2c94bb561ff4d
pythongh-102433https://github.com/python/cpython/issues/102433
6c77697https://github.com/miss-islington/cpython/commit/6c776976a819a91060dee397a0b2c94bb561ff4d
pythongh-102433: Add tests for how classes with properties interact w…https://github.com/miss-islington/cpython/commit/385fae374e8cc7614945e04fbc8d3218debe17bd
pythongh-102433https://github.com/python/cpython/issues/102433
385fae3https://github.com/miss-islington/cpython/commit/385fae374e8cc7614945e04fbc8d3218debe17bd
gh-102433: Add tests for how classes with properties interact with `i…https://github.com/python/cpython/commit/281078794f10a42d0aa99d660e25a434fde96ec4
gh-102433https://github.com/python/cpython/issues/102433
2810787https://github.com/python/cpython/commit/281078794f10a42d0aa99d660e25a434fde96ec4
gh-102433: Add tests for how classes with properties interact with `i…https://github.com/python/cpython/commit/e467cb3a691d936b6e7b2ed7cc859a8c218e9f1a
gh-102433https://github.com/python/cpython/issues/102433
e467cb3https://github.com/python/cpython/commit/e467cb3a691d936b6e7b2ed7cc859a8c218e9f1a
iritkatrielhttps://togithub.com/iritkatriel
on Mar 12, 2023https://github.com/python/cpython/issues/102433#event-8726148990
pythongh-102433: Add tests for how classes with properties interact w…https://github.com/iritkatriel/cpython/commit/fde1a99f191dd8f1f4e744bd9cfd02ac3f32430c
pythongh-102433https://github.com/python/cpython/issues/102433
fde1a99https://github.com/iritkatriel/cpython/commit/fde1a99f191dd8f1f4e744bd9cfd02ac3f32430c
AlexWaygoodhttps://togithub.com/AlexWaygood
on Apr 2, 2023https://github.com/python/cpython/issues/102433#event-8906419955
gh-102433: Use `inspect.getattr_static` in `typing._ProtocolMeta.__in…https://github.com/python/cpython/commit/6d59c9e32ebb6d8468c7eb26e7cf3efd458c7a73
gh-102433https://github.com/python/cpython/issues/102433
6d59c9ehttps://github.com/python/cpython/commit/6d59c9e32ebb6d8468c7eb26e7cf3efd458c7a73
https://togithub.com/AlexWaygood
AlexWaygoodhttps://togithub.com/AlexWaygood
on Apr 2, 2023https://github.com/python/cpython/issues/102433#issuecomment-1493334899
#103034https://github.com/python/cpython/pull/103034
AlexWaygoodhttps://togithub.com/AlexWaygood
completedhttps://togithub.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 2, 2023https://github.com/python/cpython/issues/102433#event-8906438193
gaogaotiantianhttps://togithub.com/gaogaotiantian
on Apr 8, 2023https://github.com/python/cpython/issues/102433#event-8958258762
pythongh-102433: Use `inspect.getattr_static` in `typing._ProtocolMet…https://github.com/gaogaotiantian/cpython/commit/3a0530c2bc600b1504f7b3ae28855b3faa460487
pythongh-102433https://github.com/python/cpython/issues/102433
3a0530chttps://github.com/gaogaotiantian/cpython/commit/3a0530c2bc600b1504f7b3ae28855b3faa460487
warsawhttps://togithub.com/warsaw
on Apr 11, 2023https://github.com/python/cpython/issues/102433#event-8976503526
pythongh-102433: Use `inspect.getattr_static` in `typing._ProtocolMet…https://github.com/warsaw/cpython/commit/c3c6139ac04a965326c73d81702f7923639b8fde
pythongh-102433https://github.com/python/cpython/issues/102433
c3c6139https://github.com/warsaw/cpython/commit/c3c6139ac04a965326c73d81702f7923639b8fde
jaracohttps://togithub.com/jaraco
on Oct 22, 2026https://github.com/python/cpython/issues/102433#event-33995616781
Add a protocol conformance check that consults the type.https://github.com/python/importlib_metadata/commit/b28cfd32c86ec91b2cffd9526da8be60ba340064
b28cfd3https://github.com/python/importlib_metadata/commit/b28cfd32c86ec91b2cffd9526da8be60ba340064
Sign up for freehttps://togithub.com/signup?return_to=https://github.com/python/cpython/issues/102433
Sign in to commenthttps://togithub.com/login?return_to=https://github.com/python/cpython/issues/102433
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%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.