René's URL Explorer Experiment


Title: More precise return types for open(), Path.open(), bz2.open(), etc. by ilai-deutel · Pull Request #3371 · python/typeshed · GitHub

Open Graph Title: More precise return types for open(), Path.open(), bz2.open(), etc. by ilai-deutel · Pull Request #3371 · python/typeshed

X Title: More precise return types for open(), Path.open(), bz2.open(), etc. by ilai-deutel · Pull Request #3371 · python/typeshed

Description: This PR adds overloaded signatures for {builtin,pathlib.Path,bz2,gwip,lzma}.open() functions, using Literal modes to determine the return types. mypy tests pass after updating the open and Path.open plugins and making a few changes to the expected outputs: python/mypy#7794 Fixes #2911 Related discussion: python/mypy#7643

Open Graph Description: This PR adds overloaded signatures for {builtin,pathlib.Path,bz2,gwip,lzma}.open() functions, using Literal modes to determine the return types. mypy tests pass after updating the open and Path.ope...

X Description: This PR adds overloaded signatures for {builtin,pathlib.Path,bz2,gwip,lzma}.open() functions, using Literal modes to determine the return types. mypy tests pass after updating the open and Path.ope...

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

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:8bea2018-0561-1340-21ae-11b421bbf192
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA902:DCDA8:3006067:3F52DAA:6B002699
html-safe-nonce4591bb98bce19a5dfbb79c42f247f5465e3d8fe93a6094173c32db7d717107ca
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTAyOkRDREE4OjMwMDYwNjc6M0Y1MkRBQTo2QjAwMjY5OSIsInZpc2l0b3JfaWQiOiI3NDEwMzUxODk1MDE0ODExMjg5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd3d7a35af3df65bb93049154a424b7f0e21142740d74666337f0841c0ec60ca2
hovercard-subject-tagpull_request:328625219
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/3371/files
twitter:imagehttps://avatars.githubusercontent.com/u/10098207?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10098207?s=400&v=4
og:image:altThis PR adds overloaded signatures for {builtin,pathlib.Path,bz2,gwip,lzma}.open() functions, using Literal modes to determine the return types. mypy tests pass after updating the open and Path.ope...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/typeshed/pull/3371/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fpull%2F3371%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%2F3371%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/3371/files
Reloadhttps://github.com/python/typeshed/pull/3371/files
Reloadhttps://github.com/python/typeshed/pull/3371/files
pythonhttps://github.com/python
typeshedhttps://github.com/python/typeshed
Codehttps://github.com/python/typeshed
Issues196 (196)https://github.com/python/typeshed/issues
Pull requests251 (251)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
JelleZijlstrahttps://github.com/JelleZijlstra
python:masterhttps://github.com/python/typeshed/tree/master
ilai-deutel:overloaded-openhttps://github.com/ilai-deutel/typeshed/tree/overloaded-open
Conversation 28 https://github.com/python/typeshed/pull/3371
Commits 16 https://github.com/python/typeshed/pull/3371/commits
Checks 0 https://github.com/python/typeshed/pull/3371/checks
Files changed https://github.com/python/typeshed/pull/3371/files
Please reload this pagehttps://github.com/python/typeshed/pull/3371/files
More precise return types for open(), Path.open(), bz2.open(), etc. https://github.com/python/typeshed/pull/3371/files#top
Show all changes 16 commits https://github.com/python/typeshed/pull/3371/files
71506a8 Overload on mode for open() and Path.open() ilai-deutel Oct 13, 2019 https://github.com/python/typeshed/pull/3371/commits/71506a82afed3890e48345bcb1ae32030424fc25
6bec337 Update Python2 stubs ilai-deutel Oct 16, 2019 https://github.com/python/typeshed/pull/3371/commits/6bec337d6d04c77255a92712a58f04a72bcf3887
23749a6 overload + Literal on BZ2, gzip, LZMA ilai-deutel Oct 16, 2019 https://github.com/python/typeshed/pull/3371/commits/23749a63433c3a6ce4d5f0361537957fd03724fc
952dc90 Apply black partially to builtin.pyi ilai-deutel Oct 16, 2019 https://github.com/python/typeshed/pull/3371/commits/952dc90761e599aafb5f48cfd0d35e9f0a73379e
0335f3f Fix pytype exceptions ilai-deutel Oct 16, 2019 https://github.com/python/typeshed/pull/3371/commits/0335f3fe483dff43f477623da1b82be1de15c53d
38e04fe Move _OpenBinaryMode and _OpenTextMode to io; refactor code ilai-deutel Oct 17, 2019 https://github.com/python/typeshed/pull/3371/commits/38e04feee888fd58dd7b21d36b130c50612358f5
1619c9b Fix missing import in io ilai-deutel Oct 17, 2019 https://github.com/python/typeshed/pull/3371/commits/1619c9b39f45dcc58ae606f5fee77ad2f8c0313d
1eb282e Merge branch 'master' into overloaded-open ilai-deutel Oct 25, 2019 https://github.com/python/typeshed/pull/3371/commits/1eb282ed45f279c5c005f3bfb4f2eaa53c0942fc
e6a4321 Merge branch 'master' into overloaded-open ilai-deutel Nov 11, 2019 https://github.com/python/typeshed/pull/3371/commits/e6a43215cea57c5b4448183c2b4d20f40cbcc222
3a631c0 Merge branch 'master' into overloaded-open ilai-deutel Nov 12, 2019 https://github.com/python/typeshed/pull/3371/commits/3a631c048f23cf2d92c146595de5d21ba0a6592d
f924ef2 Merge branch 'master' into overloaded-open ilai-deutel Jan 15, 2020 https://github.com/python/typeshed/pull/3371/commits/f924ef2394e81e1673608b0711f1fcc11ff4f9c0
7455811 open() always return BinaryIO in Python2 ilai-deutel Jan 15, 2020 https://github.com/python/typeshed/pull/3371/commits/7455811ca5d644a01cdfbf250732a1c77d595ecd
529d3b8 Merge branch 'master' into overloaded-open ilai-deutel Apr 12, 2020 https://github.com/python/typeshed/pull/3371/commits/529d3b87fd2f07ab4912df49ae149c43fb870cf2
a4f11f1 Merge branch 'overloaded-open' of https://github.com/ilai-deutel/type… JelleZijlstra May 28, 2020 https://github.com/python/typeshed/pull/3371/commits/a4f11f1c4bba8154d73182227b63466fc9469be3
70916ef Merge remote-tracking branch 'upstream/master' into ilai-deutel-overl… JelleZijlstra May 28, 2020 https://github.com/python/typeshed/pull/3371/commits/70916ef07de498770ac41d9b0bf1e7d6b544bb01
7bc89fe Remove support for Python 3.4 ilai-deutel May 28, 2020 https://github.com/python/typeshed/pull/3371/commits/7bc89fe5937fbef3564481b90a7f153137a39202
Clear filters https://github.com/python/typeshed/pull/3371/files
Please reload this pagehttps://github.com/python/typeshed/pull/3371/files
Please reload this pagehttps://github.com/python/typeshed/pull/3371/files
__builtin__.pyi https://github.com/python/typeshed/pull/3371/files#diff-1d779f57c4a031bf6683d708babcda1f1e1bc38fc30e63e87c3451827a870a30
io.pyi https://github.com/python/typeshed/pull/3371/files#diff-0fe1e1e94fea69559bf1315d4030bd037b0a228d46d4946072ca2d8b15fd5f67
builtins.pyi https://github.com/python/typeshed/pull/3371/files#diff-c430302cd57835815fa7401cd1322c5d1ad57c29ac2850903dff4a1380f202f8
bz2.pyi https://github.com/python/typeshed/pull/3371/files#diff-bce99d3bc08b3afed5f271ca5235c363aaef702542c61e347770b1405beea20d
gzip.pyi https://github.com/python/typeshed/pull/3371/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
io.pyi https://github.com/python/typeshed/pull/3371/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
lzma.pyi https://github.com/python/typeshed/pull/3371/files#diff-d7c3b85e687b92c58c828745c273b9274dcea7fe7687fa9c6c053b6b01fbb54c
pathlib.pyi https://github.com/python/typeshed/pull/3371/files#diff-279c92905a846af99b16e776c21be08082c4a1c72bd353086f864de43a0e2e78
pathlib2.pyi https://github.com/python/typeshed/pull/3371/files#diff-fa472f5ba0373f7c25d97a64145b3c987bd03812d78d8c29134f5007af95e079
stdlib/2/__builtin__.pyihttps://github.com/python/typeshed/pull/3371/files#diff-1d779f57c4a031bf6683d708babcda1f1e1bc38fc30e63e87c3451827a870a30
View file https://github.com/ilai-deutel/typeshed/blob/7bc89fe5937fbef3564481b90a7f153137a39202/stdlib/2/__builtin__.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/3371/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/3371/files#diff-1d779f57c4a031bf6683d708babcda1f1e1bc38fc30e63e87c3451827a870a30
https://github.com/python/typeshed/pull/3371/files#diff-1d779f57c4a031bf6683d708babcda1f1e1bc38fc30e63e87c3451827a870a30
https://github.com/python/typeshed/pull/3371/files#diff-1d779f57c4a031bf6683d708babcda1f1e1bc38fc30e63e87c3451827a870a30
https://github.com/python/typeshed/pull/3371/files#diff-1d779f57c4a031bf6683d708babcda1f1e1bc38fc30e63e87c3451827a870a30
stdlib/2/io.pyihttps://github.com/python/typeshed/pull/3371/files#diff-0fe1e1e94fea69559bf1315d4030bd037b0a228d46d4946072ca2d8b15fd5f67
View file https://github.com/ilai-deutel/typeshed/blob/7bc89fe5937fbef3564481b90a7f153137a39202/stdlib/2/io.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/3371/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/3371/files#diff-0fe1e1e94fea69559bf1315d4030bd037b0a228d46d4946072ca2d8b15fd5f67
https://github.com/python/typeshed/pull/3371/files#diff-0fe1e1e94fea69559bf1315d4030bd037b0a228d46d4946072ca2d8b15fd5f67
https://github.com/python/typeshed/pull/3371/files#diff-0fe1e1e94fea69559bf1315d4030bd037b0a228d46d4946072ca2d8b15fd5f67
stdlib/2and3/builtins.pyihttps://github.com/python/typeshed/pull/3371/files#diff-c430302cd57835815fa7401cd1322c5d1ad57c29ac2850903dff4a1380f202f8
View file https://github.com/ilai-deutel/typeshed/blob/7bc89fe5937fbef3564481b90a7f153137a39202/stdlib/2and3/builtins.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/3371/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/3371/files#diff-c430302cd57835815fa7401cd1322c5d1ad57c29ac2850903dff4a1380f202f8
https://github.com/python/typeshed/pull/3371/files#diff-c430302cd57835815fa7401cd1322c5d1ad57c29ac2850903dff4a1380f202f8
https://github.com/python/typeshed/pull/3371/files#diff-c430302cd57835815fa7401cd1322c5d1ad57c29ac2850903dff4a1380f202f8
https://github.com/python/typeshed/pull/3371/files#diff-c430302cd57835815fa7401cd1322c5d1ad57c29ac2850903dff4a1380f202f8
stdlib/2and3/bz2.pyihttps://github.com/python/typeshed/pull/3371/files#diff-bce99d3bc08b3afed5f271ca5235c363aaef702542c61e347770b1405beea20d
View file https://github.com/ilai-deutel/typeshed/blob/7bc89fe5937fbef3564481b90a7f153137a39202/stdlib/2and3/bz2.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/3371/{{ revealButtonHref }}
srittauhttps://github.com/srittau
May 28, 2020https://github.com/python/typeshed/pull/3371/files#r431757534
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typeshed/pull/3371/files
https://github.com/python/typeshed/pull/3371/files#diff-bce99d3bc08b3afed5f271ca5235c363aaef702542c61e347770b1405beea20d
stdlib/3/gzip.pyihttps://github.com/python/typeshed/pull/3371/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
View file https://github.com/ilai-deutel/typeshed/blob/7bc89fe5937fbef3564481b90a7f153137a39202/stdlib/3/gzip.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/3371/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/3371/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
https://github.com/python/typeshed/pull/3371/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
https://github.com/python/typeshed/pull/3371/files#diff-9df9b00cc949699f369cb80cbbfdd2851d8ffdbcb8e943bdf7568b4ce8e11ac7
stdlib/3/io.pyihttps://github.com/python/typeshed/pull/3371/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
View file https://github.com/ilai-deutel/typeshed/blob/7bc89fe5937fbef3564481b90a7f153137a39202/stdlib/3/io.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/3371/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/3371/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/3371/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
https://github.com/python/typeshed/pull/3371/files#diff-6d8cbfb16fc86228e7ab44b97d73ce6f66a232a60bc6beb052500a2d69b5249e
Please reload this pagehttps://github.com/python/typeshed/pull/3371/files
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.