René's URL Explorer Experiment


Title: memoryview is a Sequence but does not implement the full Sequence API · Issue #125420 · python/cpython · GitHub

Open Graph Title: memoryview is a Sequence but does not implement the full Sequence API · Issue #125420 · python/cpython

X Title: memoryview is a Sequence but does not implement the full Sequence API · Issue #125420 · python/cpython

Description: Bug report Bug description: The memoryview builtin is registered as a Sequence, but doesn't implement the full API, because it doesn't inherit from Sequence at runtime and doesn't implement the mixin methods. >>> import collections.abc >...

Open Graph Description: Bug report Bug description: The memoryview builtin is registered as a Sequence, but doesn't implement the full API, because it doesn't inherit from Sequence at runtime and doesn't implement the mix...

X Description: Bug report Bug description: The memoryview builtin is registered as a Sequence, but doesn't implement the full API, because it doesn't inherit from Sequence at runtime and doesn't imple...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"memoryview is a Sequence but does not implement the full Sequence API","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nThe `memoryview` builtin is registered as a `Sequence`, but doesn't implement the full API, because it doesn't inherit from `Sequence` at runtime and doesn't implement the mixin methods.\r\n\r\n```python\r\n>>> import collections.abc\r\n>>> issubclass(memoryview, collections.abc.Sequence)\r\nTrue\r\n>>> collections.abc.Sequence.index\r\n\u003cfunction Sequence.index at 0x10148d250>\r\n>>> memoryview.index\r\nTraceback (most recent call last):\r\n  File \"\u003cpython-input-4>\", line 1, in \u003cmodule>\r\n    memoryview.index\r\nAttributeError: type object 'memoryview' has no attribute 'index'\r\n```\r\n\r\nAmong the methods listed for Sequence in [the documentation](https://docs.python.org/3/library/collections.abc.html), memoryview is missing `__contains__`, `__reversed__`, `index`, and `count`. This is causing problems for typing; in the typeshed stubs we have to either lie one way by claiming that memoryview has methods it doesn't have, or lie another way by claiming it is not a Sequence when `issubclass()` says otherwise at runtime (python/typeshed#12800). To fix this, we should either make memoryview not a Sequence, or add the missing methods. The former has compatibility implications, so I propose to add the methods in 3.14.\r\n\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\n_No response_\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* gh-125443\r\n* gh-125446\r\n* (under consideration) gh-125441\r\n* (under consideration) gh-125505\r\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2024-10-13T23:44:33Z","url":"https://github.com/python/cpython/issues/125420"}

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:68203b4b-919e-20a7-4a58-0e986479aecc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE82:3F6072:794D:A14A:6B004F18
html-safe-noncef3f5987676e871f6b47efb9b60f4d7a1919f4fe813daf800b7b4b310ad28ef72
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTgyOjNGNjA3Mjo3OTREOkExNEE6NkIwMDRGMTgiLCJ2aXNpdG9yX2lkIjoiNjQyNDE0NzY4OTI2MDIwNzg5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf4c915eb5a95f10dea1eda6e8b799c6e03355e8bce4e18afd4848183ffe34e14
hovercard-subject-tagissue:2584386709
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/125420/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5db320dc5cf7408ae3918f7caf3650e3cd3bd2967310afd5a3c754f23df15e99/python/cpython/issues/125420
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5db320dc5cf7408ae3918f7caf3650e3cd3bd2967310afd5a3c754f23df15e99/python/cpython/issues/125420
og:image:altBug report Bug description: The memoryview builtin is registered as a Sequence, but doesn't implement the full API, because it doesn't inherit from Sequence at runtime and doesn't implement the mix...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJelleZijlstra
hostnamegithub.com
expected-hostnamegithub.com
Nonef9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b
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
releaseb27c5dde30676028abd5c5fc53ce5c9b625f8281
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/125420#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F125420
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%2Fcpython%2Fissues%2F125420
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%2Fcpython
Reloadhttps://github.com/python/cpython/issues/125420
Reloadhttps://github.com/python/cpython/issues/125420
Reloadhttps://github.com/python/cpython/issues/125420
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/125420
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/125420
memoryview is a Sequence but does not implement the full Sequence APIhttps://github.com/python/cpython/issues/125420#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 13, 2024https://github.com/python/cpython/issues/125420#issue-2584386709
the documentationhttps://docs.python.org/3/library/collections.abc.html
python/typeshed#12800https://github.com/python/typeshed/pull/12800
gh-125420: implement Sequence.count API on memoryview objects #125443https://github.com/python/cpython/pull/125443
gh-125420: implement Sequence.index API on memoryview objects #125446https://github.com/python/cpython/pull/125446
gh-125420: implement Sequence.__contains__ API on memoryview objects #125441https://github.com/python/cpython/pull/125441
gh-125420: implement Sequence.__reversed__ API on memoryview objects #125505https://github.com/python/cpython/pull/125505
Nexthttps://github.com/python/cpython/issues/125420?timeline_page=1
JelleZijlstrahttps://github.com/JelleZijlstra
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 13, 2024https://github.com/python/cpython/issues/125420#event-14621167069
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 13, 2024https://github.com/python/cpython/issues/125420#issuecomment-2409365433
@rhettingerhttps://github.com/rhettinger
@AlexWaygoodhttps://github.com/AlexWaygood
picnixzhttps://github.com/picnixz
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
on Oct 14, 2024https://github.com/python/cpython/issues/125420#event-14621596713
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2409438108
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2409522494
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2409638128
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2410732793
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2411167199
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2411172687
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2411176311
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2411233070
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2411239045
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 14, 2024https://github.com/python/cpython/issues/125420#issuecomment-2411245275
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 15, 2024https://github.com/python/cpython/issues/125420#issuecomment-2413222149
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 15, 2024https://github.com/python/cpython/issues/125420#issuecomment-2413605411
JelleZijlstrahttps://github.com/JelleZijlstra
on Dec 10, 2024https://github.com/python/cpython/issues/125420#event-15593548190
gh-125420: implement `Sequence.index` API on `memoryview` objects (#1…https://github.com/python/cpython/commit/58c753827ac7aa3d7f1495ac206c28bf2f6c67e8
gh-125420https://github.com/python/cpython/issues/125420
#1…https://github.com/python/cpython/pull/125446
58c7538https://github.com/python/cpython/commit/58c753827ac7aa3d7f1495ac206c28bf2f6c67e8
gh-125420: implement `Sequence.count` API on `memoryview` objects (#1…https://github.com/python/cpython/commit/4331832db02ff4a7598dcdd99cae31087173dce0
gh-125420https://github.com/python/cpython/issues/125420
#1…https://github.com/python/cpython/pull/125443
4331832https://github.com/python/cpython/commit/4331832db02ff4a7598dcdd99cae31087173dce0
picnixzhttps://github.com/picnixz
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
on Dec 15, 2024https://github.com/python/cpython/issues/125420#event-15660687996
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Dec 15, 2024https://github.com/python/cpython/issues/125420#issuecomment-2543833276
@JelleZijlstrahttps://github.com/JelleZijlstra
@rhettingerhttps://github.com/rhettinger
gh-125420: implement Sequence.__contains__ API on memoryview objects #125441 (comment)https://github.com/python/cpython/pull/125441#discussion_r1885415227
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Dec 15, 2024https://github.com/python/cpython/issues/125420#issuecomment-2543892337
picnixzhttps://github.com/picnixz
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
on Dec 15, 2024https://github.com/python/cpython/issues/125420#event-15661178520
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Dec 15, 2024https://github.com/python/cpython/issues/125420#issuecomment-2543895830
picnixzhttps://github.com/picnixz
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 15, 2024https://github.com/python/cpython/issues/125420#event-15661190349
srinivasreddyhttps://github.com/srinivasreddy
on Jan 8, 2025https://github.com/python/cpython/issues/125420#event-15848204226
pythongh-125420: implement `Sequence.index` API on `memoryview` objec…https://github.com/srinivasreddy/cpython/commit/cc2759a6ff86ef71044e82ddcd9aa6a2a4ab6d76
pythongh-125420https://github.com/python/cpython/issues/125420
cc2759ahttps://github.com/srinivasreddy/cpython/commit/cc2759a6ff86ef71044e82ddcd9aa6a2a4ab6d76
pythongh-125420: implement `Sequence.count` API on `memoryview` objec…https://github.com/srinivasreddy/cpython/commit/8dd00e60c8912ddb8e955de6f55ca66e8c14dc04
pythongh-125420https://github.com/python/cpython/issues/125420
8dd00e6https://github.com/srinivasreddy/cpython/commit/8dd00e60c8912ddb8e955de6f55ca66e8c14dc04
serhiy-storchakahttps://github.com/serhiy-storchaka
Struct, memoryview and array issues 🏗️https://github.com/orgs/python/projects/65
on Jul 13, 2026https://github.com/python/cpython/issues/125420#event-27900372675
github-project-automationhttps://github.com/apps/github-project-automation
Struct, memoryview and array issues 🏗️https://github.com/orgs/python/projects/65
on Jul 13, 2026https://github.com/python/cpython/issues/125420
github-project-automationhttps://github.com/apps/github-project-automation
Struct, memoryview and array issues 🏗️https://github.com/orgs/python/projects/65
on Jul 13, 2026https://github.com/python/cpython/issues/125420
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/125420
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/125420
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
Struct, memoryview and array issues 🏗️https://github.com/orgs/python/projects/65
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.