René's URL Explorer Experiment


Title: Store StopIteration.value in a struct field instead of the instance dict by kangdora · Pull Request #8301 · RustPython/RustPython · GitHub

Open Graph Title: Store StopIteration.value in a struct field instead of the instance dict by kangdora · Pull Request #8301 · RustPython/RustPython

X Title: Store StopIteration.value in a struct field instead of the instance dict by kangdora · Pull Request #8301 · RustPython/RustPython

Description: Closes #8290 This PR follows our AI policy Summary StopIteration.value was stored in the instance __dict__, so StopIteration().__dict__ was non-empty and clearing the dict lost the value, unlike CPython. It's now a struct field on PyStopIteration (#[repr(C)] + base field, the same approach as OSError and SystemExit in #8282), exposed via #[pygetset] — writable, deletable, and independent from args, with an empty __dict__ as in CPython. new_stop_iteration is also routed through the full constructor path instead of building a PyBaseException with a manual dict. This fixes a crash caused by the added payload (the old path allocated a base-sized object) and removes the per-instance dict allocation on this hot path. e = StopIteration(5) e.__dict__.clear() print(e.value) # before: None after: 5 (matches CPython) Test plan Verified against CPython 3.14.6: value for StopIteration() / (5) / (1, 2), write/delete, dict.clear(), vars(), empty __dict__, and generator return value delivery (incl. yield from). test_generators, test_generator_stop, test_yield_from: all pass. test_exceptions / extra_tests/snippets/builtin_exceptions.py: no regressions (the single test_badisinstance failure is pre-existing on main). cargo fmt / cargo clippy: clean (no new warnings). Unmarks test_pydoc's test_member_descriptor: it now passes because StopIteration.value is a real descriptor whose pydoc summary line renders as value (it was previously a plain None class attribute). Note this does not add __doc__ support to getset descriptors — StopIteration.value.__doc__ still differs from CPython, which is a separate pre-existing gap in PyGetSet. Assisted-by: Claude Code:claude-fable-5 Summary by CodeRabbit Summary by CodeRabbit Bug Fixes Improved StopIteration exception handling and initialization to make the exception’s value reliably accessible and updatable. Standardized how StopIteration is constructed, ensuring the return payload is consistently preserved whether a value is provided or not.

Open Graph Description: Closes #8290 This PR follows our AI policy Summary StopIteration.value was stored in the instance __dict__, so StopIteration().__dict__ was non-empty and clearing the dict lost the value, unlike ...

X Description: Closes #8290 This PR follows our AI policy Summary StopIteration.value was stored in the instance __dict__, so StopIteration().__dict__ was non-empty and clearing the dict lost the value, unlike ...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fe570c88-9db2-a5bd-3a62-faa5fc6e4432
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAF9A:2D8BE0:8CE7E2:B7B000:6A60047C
html-safe-nonce19c8b6a9b4e7e975bc4f116e522b7b906e24cc61bbf102205880ab4fcb266a59
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjlBOjJEOEJFMDo4Q0U3RTI6QjdCMDAwOjZBNjAwNDdDIiwidmlzaXRvcl9pZCI6IjU2NzcwMTgxOTk0NjIyNDk1OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac485a016141900f66d05008d06dbab8f39a30dee5cbc139d0a59d6e2f6997372b
hovercard-subject-tagpull_request:4074033893
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/8301/files
twitter:imagehttps://avatars.githubusercontent.com/u/182498567?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/182498567?s=400&v=4
og:image:altCloses #8290 This PR follows our AI policy Summary StopIteration.value was stored in the instance __dict__, so StopIteration().__dict__ was non-empty and clearing the dict lost the value, unlike ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5789899e92b20db289de946d86eb20bf5c9626276695d68f58a8c47cdda699b7
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
release6ddc048ddf80664b9b33547b619db10313c482f1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/8301/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F8301%2Ffiles
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%2FRustPython%2FRustPython%2Fpull%2F8301%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/8301/files
Reloadhttps://github.com/RustPython/RustPython/pull/8301/files
Reloadhttps://github.com/RustPython/RustPython/pull/8301/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8301/files
RustPython https://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Notifications https://github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://github.com/login?return_to=%2FRustPython%2FRustPython
Code https://github.com/RustPython/RustPython
Issues 294 https://github.com/RustPython/RustPython/issues
Pull requests 105 https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality 0 https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Code https://github.com/RustPython/RustPython
Issues https://github.com/RustPython/RustPython/issues
Pull requests https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
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
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
kangdora:fix-stopiteration-valuehttps://github.com/kangdora/RustPython/tree/fix-stopiteration-value
Conversation 10 https://github.com/RustPython/RustPython/pull/8301
Commits 3 https://github.com/RustPython/RustPython/pull/8301/commits
Checks 26 https://github.com/RustPython/RustPython/pull/8301/checks
Files changed 3 https://github.com/RustPython/RustPython/pull/8301/files
Store StopIteration.value in a struct field instead of the instance dict https://github.com/RustPython/RustPython/pull/8301/files#top
Show all changes 3 commits https://github.com/RustPython/RustPython/pull/8301/files
ee34610 Store StopIteration.value in a struct field like SystemExit kangdora Jul 17, 2026 https://github.com/RustPython/RustPython/pull/8301/commits/ee3461034c06c988fccd2a662929de9798aa0be3
3eca07d Unmark test_pydoc's test_member_descriptor kangdora Jul 18, 2026 https://github.com/RustPython/RustPython/pull/8301/commits/3eca07d5c7a3707a9fe58d0ba07b88cfc82a2b5f
bf33c19 Use expect instead of unwrap in new_stop_iteration kangdora Jul 18, 2026 https://github.com/RustPython/RustPython/pull/8301/commits/bf33c19265b1b054d1135c42cb187d13337a34d4
Clear filters https://github.com/RustPython/RustPython/pull/8301/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8301/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8301/files
test_pydoc.py https://github.com/RustPython/RustPython/pull/8301/files#diff-008fe90a0b4f2f8315794d10ef1a66319fce6fc8ce787963c0a910eed157107d
exceptions.rs https://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
vm_new.rs https://github.com/RustPython/RustPython/pull/8301/files#diff-0ed409205fe13b41775e66f6be22c13146e9aebf1000a069a10b39293f219a7b
Lib/test/test_pydoc/test_pydoc.pyhttps://github.com/RustPython/RustPython/pull/8301/files#diff-008fe90a0b4f2f8315794d10ef1a66319fce6fc8ce787963c0a910eed157107d
View file https://github.com/kangdora/RustPython/blob/bf33c19265b1b054d1135c42cb187d13337a34d4/Lib/test/test_pydoc/test_pydoc.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8301/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8301/files#diff-008fe90a0b4f2f8315794d10ef1a66319fce6fc8ce787963c0a910eed157107d
https://github.com/RustPython/RustPython/pull/8301/files#diff-008fe90a0b4f2f8315794d10ef1a66319fce6fc8ce787963c0a910eed157107d
crates/vm/src/exceptions.rshttps://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
View file https://github.com/kangdora/RustPython/blob/bf33c19265b1b054d1135c42cb187d13337a34d4/crates/vm/src/exceptions.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8301/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
https://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
https://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
youknowonehttps://github.com/youknowone
Jul 19, 2026https://github.com/RustPython/RustPython/pull/8301/files#r3609878107
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8301/files
https://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
https://github.com/RustPython/RustPython/pull/8301/files#diff-f527bc3e68302079a32d6da36816531e3e22dd31ff91ef0ff0f2688673712747
crates/vm/src/vm/vm_new.rshttps://github.com/RustPython/RustPython/pull/8301/files#diff-0ed409205fe13b41775e66f6be22c13146e9aebf1000a069a10b39293f219a7b
View file https://github.com/kangdora/RustPython/blob/bf33c19265b1b054d1135c42cb187d13337a34d4/crates/vm/src/vm/vm_new.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8301/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8301/files#diff-0ed409205fe13b41775e66f6be22c13146e9aebf1000a069a10b39293f219a7b
https://github.com/RustPython/RustPython/pull/8301/files#diff-0ed409205fe13b41775e66f6be22c13146e9aebf1000a069a10b39293f219a7b
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8301/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.