René's URL Explorer Experiment


Title: Introduce ReadableBuffer and WriteableBuffer Union aliases by bmerry · Pull Request #4232 · python/typeshed · GitHub

Open Graph Title: Introduce ReadableBuffer and WriteableBuffer Union aliases by bmerry · Pull Request #4232 · python/typeshed

X Title: Introduce ReadableBuffer and WriteableBuffer Union aliases by bmerry · Pull Request #4232 · python/typeshed

Description: Since typing doesn't yet have a way to express buffer protocol objects (python/typing#593), various interfaces have ended up with a mish-mash of options: some list just bytes (or just bytearray, when writable), some include mmap, some include memoryview, I think none of them include array.array even though it's explicitly mentioned as bytes-like, etc. I ran into problems because RawIOBase.readinto didn't allow for memoryview. To allow for some uniformity until the fundamental issue is resolved, I've introduced _typeshed.ReadableBuffer and _typeshed.WriteableBuffer, and applied them in stdlib/3/io.pyi as an example. If these get rolled out in more places, it will mean that we have only one place where they have to get tweaked in future, or swapped out for a public protocol. This unfortunately does have the potential to break code that inherits from RawIOBase/BufferedIOBase and overrides these methods, because the base method is now more general and so the override now needs to accept these types as well (which is why I've also updated gzip and lzma). However, it should be a reasonably easy fix, and will make the downstream annotations more correct. I'm not 100% happy with the names: bytes-like is slightly stricter than just buffer protocol (it must be able to export a C-contiguous buffer), but in practice I'd be surprised if there are types for which there is a difference at static analysis time (e.g. not every memoryview instance is bytes-like, but that's a property of instances, not types).

Open Graph Description: Since typing doesn't yet have a way to express buffer protocol objects (python/typing#593), various interfaces have ended up with a mish-mash of options: some list just bytes (or just bytearray...

X Description: Since typing doesn't yet have a way to express buffer protocol objects (python/typing#593), various interfaces have ended up with a mish-mash of options: some list just bytes (or just bytea...

Opengraph URL: https://github.com/python/typeshed/pull/4232

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:059def64-bcb3-42c5-4716-ea4e10763383
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9A1C:2D8191:9B58A2:CE6FEC:6B00440A
html-safe-nonce81e33a9e3243398fe5069a2f249409c16533de31680e432403fcb559b14f7c27
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTFDOjJEODE5MTo5QjU4QTI6Q0U2RkVDOjZCMDA0NDBBIiwidmlzaXRvcl9pZCI6IjE1MTkxNTQ3MjQ5NDE2MTIwNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf72f9b2a20fc24aa578a3d5a4d2d276ae8321e8095edf19d8e91e5401bcbf3b6
hovercard-subject-tagpull_request:434343953
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///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/typeshed/pull/4232/files
twitter:imagehttps://avatars.githubusercontent.com/u/1963944?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1963944?s=400&v=4
og:image:altSince typing doesn't yet have a way to express buffer protocol objects (python/typing#593), various interfaces have ended up with a mish-mash of options: some list just bytes (or just bytearray...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
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

Links:

Skip to contenthttps://github.com/python/typeshed/pull/4232/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fpull%2F4232%2Ffiles
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%2Fpull%2F4232%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Ftypeshed
Reloadhttps://github.com/python/typeshed/pull/4232/files
Reloadhttps://github.com/python/typeshed/pull/4232/files
Reloadhttps://github.com/python/typeshed/pull/4232/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Ftypeshed%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Ftypeshed%2Fissues%2Fnew%2Fchoose
srittauhttps://github.com/srittau
python:masterhttps://github.com/python/typeshed/tree/master
bmerry:byteslike-aliaseshttps://github.com/bmerry/typeshed/tree/byteslike-aliases
Conversation 3 https://github.com/python/typeshed/pull/4232
Commits 1 https://github.com/python/typeshed/pull/4232/commits
Checks 0 https://github.com/python/typeshed/pull/4232/checks
Files changed https://github.com/python/typeshed/pull/4232/files
Please reload this pagehttps://github.com/python/typeshed/pull/4232/files
Introduce ReadableBuffer and WriteableBuffer Union aliases https://github.com/python/typeshed/pull/4232/files#top
Show all changes 1 commit https://github.com/python/typeshed/pull/4232/files
0c0bcf4 Introduce ReadableBuffer and WriteableBuffer Union aliases bmerry Jun 15, 2020 https://github.com/python/typeshed/pull/4232/commits/0c0bcf40038c99776a6f6f3322c91278ea8e568c
Clear filters https://github.com/python/typeshed/pull/4232/files
Please reload this pagehttps://github.com/python/typeshed/pull/4232/files
Please reload this pagehttps://github.com/python/typeshed/pull/4232/files
__init__.pyi https://github.com/python/typeshed/pull/4232/files#diff-d88d19d07ffe6d8ae1093f03b378b27a69e98d56779649a70537bdd407d3e6a3
gzip.pyi https://github.com/python/typeshed/pull/4232/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
io.pyi https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
lzma.pyi https://github.com/python/typeshed/pull/4232/files#diff-d7c3b85e687b92c58c828745c273b9274dcea7fe7687fa9c6c053b6b01fbb54c
stdlib/2and3/_typeshed/__init__.pyihttps://github.com/python/typeshed/pull/4232/files#diff-d88d19d07ffe6d8ae1093f03b378b27a69e98d56779649a70537bdd407d3e6a3
View file https://github.com/bmerry/typeshed/blob/0c0bcf40038c99776a6f6f3322c91278ea8e568c/stdlib/2and3/_typeshed/__init__.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/4232/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/4232/files#diff-d88d19d07ffe6d8ae1093f03b378b27a69e98d56779649a70537bdd407d3e6a3
https://github.com/python/typeshed/pull/4232/files#diff-d88d19d07ffe6d8ae1093f03b378b27a69e98d56779649a70537bdd407d3e6a3
https://github.com/python/typeshed/pull/4232/files#diff-d88d19d07ffe6d8ae1093f03b378b27a69e98d56779649a70537bdd407d3e6a3
stdlib/3/gzip.pyihttps://github.com/python/typeshed/pull/4232/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
View file https://github.com/bmerry/typeshed/blob/0c0bcf40038c99776a6f6f3322c91278ea8e568c/stdlib/3/gzip.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/4232/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/4232/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
https://github.com/python/typeshed/pull/4232/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
https://github.com/python/typeshed/pull/4232/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
https://github.com/python/typeshed/pull/4232/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
stdlib/3/io.pyihttps://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
View file https://github.com/bmerry/typeshed/blob/0c0bcf40038c99776a6f6f3322c91278ea8e568c/stdlib/3/io.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/4232/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/4232/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
stdlib/3/lzma.pyihttps://github.com/python/typeshed/pull/4232/files#diff-d7c3b85e687b92c58c828745c273b9274dcea7fe7687fa9c6c053b6b01fbb54c
View file https://github.com/bmerry/typeshed/blob/0c0bcf40038c99776a6f6f3322c91278ea8e568c/stdlib/3/lzma.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/4232/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/4232/files#diff-d7c3b85e687b92c58c828745c273b9274dcea7fe7687fa9c6c053b6b01fbb54c
https://github.com/python/typeshed/pull/4232/files#diff-d7c3b85e687b92c58c828745c273b9274dcea7fe7687fa9c6c053b6b01fbb54c
https://github.com/python/typeshed/pull/4232/files#diff-d7c3b85e687b92c58c828745c273b9274dcea7fe7687fa9c6c053b6b01fbb54c
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.