René's URL Explorer Experiment


Title: Adding descriptor methods to _SimpleCData by DrInfiniteExplorer · Pull Request #11272 · python/typeshed · GitHub

Open Graph Title: Adding descriptor methods to _SimpleCData by DrInfiniteExplorer · Pull Request #11272 · python/typeshed

X Title: Adding descriptor methods to _SimpleCData by DrInfiniteExplorer · Pull Request #11272 · python/typeshed

Description: This allows adding type annotations to structures and unions that resolve to the underlying types when accessed inside structures. I don't know how to make proper tests for this, so I've made some examples where I've marked the lines that are expected to fail typechecking. import ctypes class Annotated(ctypes.Structure): _fields_ = [("x", ctypes.c_int), ("y", ctypes.c_int), ("z", ctypes.c_int), ("f", ctypes.c_float)] x: ctypes.c_int y: ctypes.c_int z: ctypes.c_int f: ctypes.c_float class NoAnnotation(ctypes.Structure): _fields_ = [("x", ctypes.c_int, "vec", Annotated)] class NonCType: x : ctypes.c_int ctypes.c_int().value += 2 ctypes.c_int() += 2 # FAIL ctypes.c_float().value += 2 ctypes.c_float() += 2 # FAIL # All passes; all access are Any NoAnnotation().x += 2 NoAnnotation().vec.x += 2 NoAnnotation().noexist += 2 Annotated.x.value += 2 Annotated.x += 2 # FAIL Annotated().x += 2 Annotated().x.value += 2 # FAIL Annotated().f += 3.14 Annotated().f.value += 3.14 # FAIL NonCType.x.value += 2 NonCType.x += 2 # FAIL NonCType().x += 2 # FAIL NonCType().x.value += 2

Open Graph Description: This allows adding type annotations to structures and unions that resolve to the underlying types when accessed inside structures. I don't know how to make proper tests for this, so I've ma...

X Description: This allows adding type annotations to structures and unions that resolve to the underlying types when accessed inside structures. I don't know how to make proper tests for this, so I&#...

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

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:47d8c14f-111e-69c1-1061-72e44be4ec63
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9A6C:3FDF0C:B645D7:F2D5C2:6B0049A2
html-safe-nonce9ff7805c5d33ff9b4b8d8a498780b5748497a3eb8e6e389b3507cce32087a078
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTZDOjNGREYwQzpCNjQ1RDc6RjJENUMyOjZCMDA0OUEyIiwidmlzaXRvcl9pZCI6Ijc2Njk0NjI4MjY2OTEzNDg4OTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac155187f07ab517e07294b1cffef3d4f39b341073d68eca3ba728dc8dc049cf91
hovercard-subject-tagpull_request:1678018900
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/11272/files
twitter:imagehttps://avatars.githubusercontent.com/u/5090341?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5090341?s=400&v=4
og:image:altThis allows adding type annotations to structures and unions that resolve to the underlying types when accessed inside structures. I don't know how to make proper tests for this, so I've ma...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b
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
releaseb27c5dde30676028abd5c5fc53ce5c9b625f8281
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/typeshed/pull/11272/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fpull%2F11272%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%2F11272%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/11272/files
Reloadhttps://github.com/python/typeshed/pull/11272/files
Reloadhttps://github.com/python/typeshed/pull/11272/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
DrInfiniteExplorerhttps://github.com/DrInfiniteExplorer
python:mainhttps://github.com/python/typeshed/tree/main
Conversation 8 https://github.com/python/typeshed/pull/11272
Commits 5 https://github.com/python/typeshed/pull/11272/commits
Checks 0 https://github.com/python/typeshed/pull/11272/checks
Files changed https://github.com/python/typeshed/pull/11272/files
Please reload this pagehttps://github.com/python/typeshed/pull/11272/files
Adding descriptor methods to _SimpleCData https://github.com/python/typeshed/pull/11272/files#top
Show all changes 5 commits https://github.com/python/typeshed/pull/11272/files
3855297 Adding descriptor methods to _SimpleCData DrInfiniteExplorer Jan 14, 2024 https://github.com/python/typeshed/pull/11272/commits/3855297bb55e0b9abcafc23c7e6f68f72ba4020d
4a4820e Not sure if this is the right way to go about it. Would be happy with… DrInfiniteExplorer Jan 14, 2024 https://github.com/python/typeshed/pull/11272/commits/4a4820e330e69d579a38f78557d3da47de5fbdc8
135c443 Adding regression test for ctypes DrInfiniteExplorer Jan 14, 2024 https://github.com/python/typeshed/pull/11272/commits/135c4437351138d1392110333c737a9ee4dbcf35
1d340f4 [pre-commit.ci] auto fixes from pre-commit.com hooks pre-commit-ci[bot] Jan 14, 2024 https://github.com/python/typeshed/pull/11272/commits/1d340f41e3ebc7f24ad202f2110a616e5505666d
c0f5d10 Merge branch 'main' into main AlexWaygood Feb 5, 2024 https://github.com/python/typeshed/pull/11272/commits/c0f5d10e9552649ae0a2a306e8df4654e5501f5a
Clear filters https://github.com/python/typeshed/pull/11272/files
Please reload this pagehttps://github.com/python/typeshed/pull/11272/files
Please reload this pagehttps://github.com/python/typeshed/pull/11272/files
_ctypes.pyi https://github.com/python/typeshed/pull/11272/files#diff-6a875521599e1d7da2da8880642a9163bccf0d8d1294a3ff460666fcd7bb0fd7
check_ctypes.py https://github.com/python/typeshed/pull/11272/files#diff-ab75e28ae69707e52ac2dafa6411669c0e673da5cdfa45326179dd2e1907bf9a
py3_common.txt https://github.com/python/typeshed/pull/11272/files#diff-6d131fcd4c0858a55e2f1e0f4a7b6ca5955901573d9fd93432eb637ff5f60c24
stdlib/_ctypes.pyihttps://github.com/python/typeshed/pull/11272/files#diff-6a875521599e1d7da2da8880642a9163bccf0d8d1294a3ff460666fcd7bb0fd7
View file https://github.com/python/typeshed/blob/c0f5d10e9552649ae0a2a306e8df4654e5501f5a/stdlib/_ctypes.pyi
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/11272/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/11272/files#diff-6a875521599e1d7da2da8880642a9163bccf0d8d1294a3ff460666fcd7bb0fd7
https://github.com/python/typeshed/pull/11272/files#diff-6a875521599e1d7da2da8880642a9163bccf0d8d1294a3ff460666fcd7bb0fd7
test_cases/stdlib/check_ctypes.pyhttps://github.com/python/typeshed/pull/11272/files#diff-ab75e28ae69707e52ac2dafa6411669c0e673da5cdfa45326179dd2e1907bf9a
View file https://github.com/python/typeshed/blob/c0f5d10e9552649ae0a2a306e8df4654e5501f5a/test_cases/stdlib/check_ctypes.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/11272/{{ revealButtonHref }}
tests/stubtest_allowlists/py3_common.txthttps://github.com/python/typeshed/pull/11272/files#diff-6d131fcd4c0858a55e2f1e0f4a7b6ca5955901573d9fd93432eb637ff5f60c24
View file https://github.com/python/typeshed/blob/c0f5d10e9552649ae0a2a306e8df4654e5501f5a/tests/stubtest_allowlists/py3_common.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typeshed/pull/11272/{{ revealButtonHref }}
https://github.com/python/typeshed/pull/11272/files#diff-6d131fcd4c0858a55e2f1e0f4a7b6ca5955901573d9fd93432eb637ff5f60c24
https://github.com/python/typeshed/pull/11272/files#diff-6d131fcd4c0858a55e2f1e0f4a7b6ca5955901573d9fd93432eb637ff5f60c24
https://github.com/python/typeshed/pull/11272/files#diff-6d131fcd4c0858a55e2f1e0f4a7b6ca5955901573d9fd93432eb637ff5f60c24
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.