René's URL Explorer Experiment


Title: Add explicit Python collection conversion adapters by 1ndahous3 · Pull Request #9372 · RustPython/RustPython · GitHub

Open Graph Title: Add explicit Python collection conversion adapters by 1ndahous3 · Pull Request #9372 · RustPython/RustPython

X Title: Add explicit Python collection conversion adapters by 1ndahous3 · Pull Request #9372 · RustPython/RustPython

Description: This proposal comes from my personal project, br3k, which uses an embedded RustPython VM: Definitions: custom PyListOf adapter. Usage: returning process modules as a Python list. Stub generation: mapping PyListOf to list[T]. The call_between_rust_and_python example also had its own list conversion wrapper. Summary Add PyListOf, PySetOf and PyDictOf for constructing Python collections from Rust iterators. Explicit list conversion includes u8 without changing Vec conversion to bytes. Use Python hashing and equality for sets and dictionaries, propagating construction errors and stopping at the failing item. Preserve collection identity when cloning or returning an adapter, with GC traversal of the owned reference. Keep element access untyped: type parameters describe construction, while Python can subsequently mutate the collections. Replace manual collection conversion in CSV dialect listing, signal sets, and sys._current_frames() / sys._current_exceptions() while preserving snapshots and object identity. Show built-in list conversion alongside a custom domain conversion in the embedding example. Example let labels = PyListOf::new(["ready", "done"], vm); let flags = PySetOf::try_new([1, 2, 1], vm)?; let counts = PyDictOf::try_new([("ready", 2), ("done", 1)], vm)?; AI assistance Written with Codex (GPT-6), reviewed by a human before submission. Summary by CodeRabbit New Features Added typed helpers for creating Python lists, dictionaries, and sets from Rust values. Dictionary keys and set items follow Python equality and duplicate-handling behavior. Expanded the Rust–Python interoperability example with ordered measurements and list-based values.

Open Graph Description: This proposal comes from my personal project, br3k, which uses an embedded RustPython VM: Definitions: custom PyListOf<T> adapter. Usage: returning process modules as a Python list. Stub gen...

X Description: This proposal comes from my personal project, br3k, which uses an embedded RustPython VM: Definitions: custom PyListOf&lt;T&gt; adapter. Usage: returning process modules as a Python list. ...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9372

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:e01a4d78-b921-aa1f-6ac9-b4574bbc732e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id93A2:34DB8F:3220172:4302E40:6B01FE27
html-safe-nonceba439d5a0b3f41e2e38dfa15975679f8fd504ec4c5fc162c6a51a17ce4eaeb75
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0EyOjM0REI4RjozMjIwMTcyOjQzMDJFNDA6NkIwMUZFMjciLCJ2aXNpdG9yX2lkIjoiODI0OTMyNDIwNDIyODYwMzI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8582884177bbc3ddee961265d67da7673b21a35a21bc5963a8b78147c3708883
hovercard-subject-tagpull_request:5009300905
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/RustPython/RustPython/pull/9372/files
twitter:imagehttps://avatars.githubusercontent.com/u/9205230?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9205230?s=400&v=4
og:image:altThis proposal comes from my personal project, br3k, which uses an embedded RustPython VM: Definitions: custom PyListOf<T> adapter. Usage: returning process modules as a Python list. Stub gen...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9372/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9372%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%2FRustPython%2FRustPython%2Fpull%2F9372%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=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9372/files
Reloadhttps://github.com/RustPython/RustPython/pull/9372/files
Reloadhttps://github.com/RustPython/RustPython/pull/9372/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
1ndahous3https://github.com/1ndahous3
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
1ndahous3:py_collection_adaptershttps://github.com/1ndahous3/RustPython/tree/py_collection_adapters
Conversation 5 https://github.com/RustPython/RustPython/pull/9372
Commits 3 https://github.com/RustPython/RustPython/pull/9372/commits
Checks 28 https://github.com/RustPython/RustPython/pull/9372/checks
Files changed https://github.com/RustPython/RustPython/pull/9372/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9372/files
Add explicit Python collection conversion adapters https://github.com/RustPython/RustPython/pull/9372/files#top
Show all changes 3 commits https://github.com/RustPython/RustPython/pull/9372/files
64e8454 Add an explicit Python list conversion adapter 1ndahous3 Oct 24, 2026 https://github.com/RustPython/RustPython/pull/9372/commits/64e84540cda2c7563a113b337ff67550c89d6802
703a6b6 Add dict and set conversion adapters 1ndahous3 Oct 24, 2026 https://github.com/RustPython/RustPython/pull/9372/commits/703a6b69b1a196658036aa5af1b3d29088b34fce
10d7ff6 Use collection adapters in CSV, signals and sys 1ndahous3 Oct 25, 2026 https://github.com/RustPython/RustPython/pull/9372/commits/10d7ff6d533423b05228006251f0e96cd531242d
Clear filters https://github.com/RustPython/RustPython/pull/9372/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9372/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9372/files
csv.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-acf098d7e921238a0873aca66fb246b2f9e424ac9fac0419462c7cbad68c95a8
dict.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-89fc40d0fe42b8331fa65b3a7578fb5af2f3b3bdc2f1e3351369b8554ab40ffa
list.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-c752a1e47b00726702bf1aa7ca441828021b1738352cdee989f615a26b943370
mod.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-7c7f03395f870b0e3a36c3de44bbd33920e9fa2b1b8ab7a946024ca3ff1bdbb3
set.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-246fe70641e5b1c73553c377fc3230bd95727d6e70afe38b2299ec8dbb5b3c7d
_signal.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-277e8770c8f1721bb34a035e1cf3bbd5938fec26b3e6b71382cb89253e03bb86
sys.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-e7f7c10b81f88d7af77af76257284e18e72ed9da63ff63675a9e9cb31c8d262d
call_between_rust_and_python.py https://github.com/RustPython/RustPython/pull/9372/files#diff-97148ffd20111601c90c94a4075c9c3ac53fbf6dddc5d79b830d09d8557f5fed
call_between_rust_and_python.rs https://github.com/RustPython/RustPython/pull/9372/files#diff-bb6b8bb28cdc9011d20463b22ca21c3118a2c2de914b7fa36a0575bba6f6185b
crates/stdlib/src/csv.rshttps://github.com/RustPython/RustPython/pull/9372/files#diff-acf098d7e921238a0873aca66fb246b2f9e424ac9fac0419462c7cbad68c95a8
View file https://github.com/RustPython/RustPython/blob/10d7ff6d533423b05228006251f0e96cd531242d/crates/stdlib/src/csv.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9372/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9372/files#diff-acf098d7e921238a0873aca66fb246b2f9e424ac9fac0419462c7cbad68c95a8
https://github.com/RustPython/RustPython/pull/9372/files#diff-acf098d7e921238a0873aca66fb246b2f9e424ac9fac0419462c7cbad68c95a8
https://github.com/RustPython/RustPython/pull/9372/files#diff-acf098d7e921238a0873aca66fb246b2f9e424ac9fac0419462c7cbad68c95a8
https://github.com/RustPython/RustPython/pull/9372/files#diff-acf098d7e921238a0873aca66fb246b2f9e424ac9fac0419462c7cbad68c95a8
crates/vm/src/convert/dict.rshttps://github.com/RustPython/RustPython/pull/9372/files#diff-89fc40d0fe42b8331fa65b3a7578fb5af2f3b3bdc2f1e3351369b8554ab40ffa
View file https://github.com/RustPython/RustPython/blob/10d7ff6d533423b05228006251f0e96cd531242d/crates/vm/src/convert/dict.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9372/{{ revealButtonHref }}
crates/vm/src/convert/list.rshttps://github.com/RustPython/RustPython/pull/9372/files#diff-c752a1e47b00726702bf1aa7ca441828021b1738352cdee989f615a26b943370
View file https://github.com/RustPython/RustPython/blob/10d7ff6d533423b05228006251f0e96cd531242d/crates/vm/src/convert/list.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9372/{{ revealButtonHref }}
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9372/files
crates/vm/src/convert/mod.rshttps://github.com/RustPython/RustPython/pull/9372/files#diff-7c7f03395f870b0e3a36c3de44bbd33920e9fa2b1b8ab7a946024ca3ff1bdbb3
View file https://github.com/RustPython/RustPython/blob/10d7ff6d533423b05228006251f0e96cd531242d/crates/vm/src/convert/mod.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9372/{{ revealButtonHref }}
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9372/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9372/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.