René's URL Explorer Experiment


Title: `socket.socketpair`'s `type` parameter accepts `SocketType` on non-Windows · Issue #15283 · python/typeshed · GitHub

Open Graph Title: `socket.socketpair`'s `type` parameter accepts `SocketType` on non-Windows · Issue #15283 · python/typeshed

X Title: `socket.socketpair`'s `type` parameter accepts `SocketType` on non-Windows · Issue #15283 · python/typeshed

Description: socket.socketpair's type parameter on non-Windows platforms is annotated SocketType | int: typeshed/stdlib/socket.pyi Lines 1411 to 1413 in cd8b26b def socketpair( family: int | AddressFamily | None = None, type: SocketType | int = ..., ...

Open Graph Description: socket.socketpair's type parameter on non-Windows platforms is annotated SocketType | int: typeshed/stdlib/socket.pyi Lines 1411 to 1413 in cd8b26b def socketpair( family: int | AddressFamily | Non...

X Description: socket.socketpair's type parameter on non-Windows platforms is annotated SocketType | int: typeshed/stdlib/socket.pyi Lines 1411 to 1413 in cd8b26b def socketpair( family: int | AddressFamily |...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`socket.socketpair`'s `type` parameter accepts `SocketType` on non-Windows","articleBody":"`socket.socketpair`'s `type` parameter on non-Windows platforms is annotated `SocketType | int`:\n\nhttps://github.com/python/typeshed/blob/cd8b26b0ceef26cd84ab614088140d48680ac7f7/stdlib/socket.pyi#L1411-L1413\n\nIt seems like it should be `SocketKind | int`, similar to the `type` parameter of `socket.socket` and `socket.fromfd`:\n\nhttps://github.com/python/typeshed/blob/cd8b26b0ceef26cd84ab614088140d48680ac7f7/stdlib/socket.pyi#L1319-L1321\n\nhttps://github.com/python/typeshed/blob/cd8b26b0ceef26cd84ab614088140d48680ac7f7/stdlib/socket.pyi#L1396\n\nPassing a `SocketKind` (e.g. `socket.socketpair(type=SocketKind.SOCK_STREAM)`) already works fine since `SocketKind` is an `int` subtype. I don't think that `SocketType` is supported though. There don't appear to be any paths in CPython where a `SocketType` is accepted; the only two paths are\n\n*   Pass the `type: SocketType` to `socket.socket`: https://github.com/python/cpython/blob/v3.14.2/Lib/socket.py#L659-L668, which blows up:\n\n    ```\n    Traceback (most recent call last):\n      File \"/tmp/tmp.SPNfuStkPY/eg.py\", line 3, in \u003cmodule\u003e\n        socketlib.socketpair(type=socketlib.socket())\n        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\n      File \"/home/ganden/.pyenv/versions/3.13/lib/python3.13/socket.py\", line 659, in socketpair\n        a, b = _socket.socketpair(family, type, proto)\n               ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n    TypeError: 'socket' object cannot be interpreted as an integer\n    ```\n\n*   Or blow up if `type` is anything but `SocketKind.SOCK_STREAM`:\n\n    https://github.com/python/cpython/blob/v3.14.2/Lib/socket.py#L604-L613","author":{"url":"https://github.com/gschaffner","@type":"Person","name":"gschaffner"},"datePublished":"2026-01-15T06:15:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/15283/typeshed/issues/15283"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bab42955-2946-2c69-11f7-46b57c1c4d94
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD83E:FA21D:3485A0:4A851C:6A632237
html-safe-noncefac36a3a35cd000b726a62411e51b988f5213598bd32ec148a23dfdcfe2a8267
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODNFOkZBMjFEOjM0ODVBMDo0QTg1MUM6NkE2MzIyMzciLCJ2aXNpdG9yX2lkIjoiNDM1NDQ1ODE0ODIyNzE5NTQ0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace1fd8be56163f0241d979a6072c0f516d5ab8721324b0f900538e1155e8e98ca
hovercard-subject-tagissue:3816162988
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/15283/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d04cf795fbcff5e53632232b6ce0a86de82cffe21aa2ec52b7b6795d9a04b6eb/python/typeshed/issues/15283
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d04cf795fbcff5e53632232b6ce0a86de82cffe21aa2ec52b7b6795d9a04b6eb/python/typeshed/issues/15283
og:image:altsocket.socketpair's type parameter on non-Windows platforms is annotated SocketType | int: typeshed/stdlib/socket.pyi Lines 1411 to 1413 in cd8b26b def socketpair( family: int | AddressFamily | Non...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegschaffner
hostnamegithub.com
expected-hostnamegithub.com
None1a6c056e02f174fffc096c521ec0ff6fb83e40a2ec8cb8875466ec1524872dd6
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
release6a93e25585f487ddff9e3996c06d5b869d6e1828
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/typeshed/issues/15283#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F15283
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F15283
Sign up https://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/15283
Reloadhttps://github.com/python/typeshed/issues/15283
Reloadhttps://github.com/python/typeshed/issues/15283
Please reload this pagehttps://github.com/python/typeshed/issues/15283
python https://github.com/python
typeshedhttps://github.com/python/typeshed
Please reload this pagehttps://github.com/python/typeshed/issues/15283
Notifications https://github.com/login?return_to=%2Fpython%2Ftypeshed
Fork 2.1k https://github.com/login?return_to=%2Fpython%2Ftypeshed
Star 5.1k https://github.com/login?return_to=%2Fpython%2Ftypeshed
Code https://github.com/python/typeshed
Issues 217 https://github.com/python/typeshed/issues
Pull requests 139 https://github.com/python/typeshed/pulls
Actions https://github.com/python/typeshed/actions
Security and quality 0 https://github.com/python/typeshed/security
Insights https://github.com/python/typeshed/pulse
Code https://github.com/python/typeshed
Issues https://github.com/python/typeshed/issues
Pull requests https://github.com/python/typeshed/pulls
Actions https://github.com/python/typeshed/actions
Security and quality https://github.com/python/typeshed/security
Insights https://github.com/python/typeshed/pulse
#15284https://github.com/python/typeshed/pull/15284
socket.socketpair's type parameter accepts SocketType on non-Windowshttps://github.com/python/typeshed/issues/15283#top
#15284https://github.com/python/typeshed/pull/15284
stubs: false negativeType checkers do not report an error, but shouldhttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22stubs%3A%20false%20negative%22
https://github.com/gschaffner
gschaffnerhttps://github.com/gschaffner
on Jan 15, 2026https://github.com/python/typeshed/issues/15283#issue-3816162988
typeshed/stdlib/socket.pyihttps://github.com/python/typeshed/blob/cd8b26b0ceef26cd84ab614088140d48680ac7f7/stdlib/socket.pyi#L1411-L1413
cd8b26bhttps://github.com/python/typeshed/commit/cd8b26b0ceef26cd84ab614088140d48680ac7f7
typeshed/stdlib/socket.pyihttps://github.com/python/typeshed/blob/cd8b26b0ceef26cd84ab614088140d48680ac7f7/stdlib/socket.pyi#L1319-L1321
cd8b26bhttps://github.com/python/typeshed/commit/cd8b26b0ceef26cd84ab614088140d48680ac7f7
typeshed/stdlib/socket.pyihttps://github.com/python/typeshed/blob/cd8b26b0ceef26cd84ab614088140d48680ac7f7/stdlib/socket.pyi#L1396
cd8b26bhttps://github.com/python/typeshed/commit/cd8b26b0ceef26cd84ab614088140d48680ac7f7
https://github.com/python/cpython/blob/v3.14.2/Lib/socket.py#L659-L668https://github.com/python/cpython/blob/v3.14.2/Lib/socket.py#L659-L668
https://github.com/python/cpython/blob/v3.14.2/Lib/socket.py#L604-L613https://github.com/python/cpython/blob/v3.14.2/Lib/socket.py#L604-L613
stubs: false negativeType checkers do not report an error, but shouldhttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22stubs%3A%20false%20negative%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.