René's URL Explorer Experiment


Title: Address #8807 review: negative defaults, to_bytes signed, get_self, fstat by youknowone · Pull Request #8810 · RustPython/RustPython · GitHub

Open Graph Title: Address #8807 review: negative defaults, to_bytes signed, get_self, fstat by youknowone · Pull Request #8810 · RustPython/RustPython

X Title: Address #8807 review: negative defaults, to_bytes signed, get_self, fstat by youknowone · Pull Request #8810 · RustPython/RustPython

Description: Follow-up to #8807. It addresses the CodeRabbit review comments posted after the merge. Summary Negative literal defaults: python_default_repr now renders negated int and float literals, and looks through parentheses and groups. Before, default = -1 produced . Now str.split shows maxsplit=-1 and str.replace shows count=-1, matching CPython. int.to_bytes: signed is ArgIntoBool again, so any object is accepted by truthiness. #8807 had narrowed it to bool, which made (1).to_bytes(signed=[]) raise TypeError. The signature still shows signed=False via py_default. PyNativeFunction::get_self: falls back to the module object, like PyCFunction_GetSelf. Call binding still uses only the bound zelf. os.fstat: has its own single-fd argument struct instead of reusing stat's arguments. Its signature is now ($module, /, fd) as in CPython, and os.fstat(fd=0) works. Test plan cargo clippy --workspace --all-targets ... -- -D warnings (cd crates/capi && cargo test) extra_tests/snippets/builtin_signature.py -m test test_inspect test_pydoc test_os test_posix test_long test_bytes test_str test_functools test_unittest test_builtin all pass. test_int passes on some runs and fails on others. The failure is the same timing-based test_denial_of_service_prevented_str_to_int that flaked on macOS CI for #8807. 🤖 Generated with Claude Code Summary by CodeRabbit Bug Fixes Negative integer and floating-point defaults, including parenthesized expressions, are now represented correctly in generated Python signatures. Whole-number floating-point defaults now retain a .0 suffix in generated signatures. Native functions without a bound instance now expose their associated module object as __self__. int.to_bytes() now interprets its signed argument using Python truthiness. Behavior Changes os.fstat() now accepts a file descriptor only; path, dir_fd, and symlink options remain available through os.stat().

Open Graph Description: Follow-up to #8807. It addresses the CodeRabbit review comments posted after the merge. Summary Negative literal defaults: python_default_repr now renders negated int and float literals, and looks...

X Description: Follow-up to #8807. It addresses the CodeRabbit review comments posted after the merge. Summary Negative literal defaults: python_default_repr now renders negated int and float literals, and looks...

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

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:dd185622-a94e-f1af-ebc3-53d5a595e24d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id82DA:296654:35C2564:479AE6E:6B020788
html-safe-nonce253269f119f02e0ac748a0cbc689cf8f69c77bd2b812bb13fae3101d75276ee0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkRBOjI5NjY1NDozNUMyNTY0OjQ3OUFFNkU6NkIwMjA3ODgiLCJ2aXNpdG9yX2lkIjoiMzczNTE2NjM0NDY1MzcyMDQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4cb0e80cb8f30a9bef0c65bd569b2c845b6b77bade6c867ec6fb85fd4ae968a4
hovercard-subject-tagpull_request:4626031938
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/8810/files
twitter:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
og:image:altFollow-up to #8807. It addresses the CodeRabbit review comments posted after the merge. Summary Negative literal defaults: python_default_repr now renders negated int and float literals, and looks...
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/8810/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F8810%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%2F8810%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/8810/files
Reloadhttps://github.com/RustPython/RustPython/pull/8810/files
Reloadhttps://github.com/RustPython/RustPython/pull/8810/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
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowone:text-signature-reviewhttps://github.com/youknowone/RustPython/tree/text-signature-review
Conversation 6 https://github.com/RustPython/RustPython/pull/8810
Commits 2 https://github.com/RustPython/RustPython/pull/8810/commits
Checks 28 https://github.com/RustPython/RustPython/pull/8810/checks
Files changed https://github.com/RustPython/RustPython/pull/8810/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8810/files
Address #8807 review: negative defaults, to_bytes signed, get_self, fstat https://github.com/RustPython/RustPython/pull/8810/files#top
Show all changes 2 commits https://github.com/RustPython/RustPython/pull/8810/files
46f4007 address review: negative defaults, to_bytes signed, get_self, fstat youknowone Sep 24, 2026 https://github.com/RustPython/RustPython/pull/8810/commits/46f4007a5c8184a9684d5b9988872b3a441cd5b5
770c381 address review: literal default rendering and fstat supports sets youknowone Sep 24, 2026 https://github.com/RustPython/RustPython/pull/8810/commits/770c38169f53b98a296948711651fb1d53bfcb90
Clear filters https://github.com/RustPython/RustPython/pull/8810/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8810/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8810/files
from_args.rs https://github.com/RustPython/RustPython/pull/8810/files#diff-90c094cca198d94b0145e4a485172fba68de5c77f49fcd05a6b882896721f1c9
builtin_func.rs https://github.com/RustPython/RustPython/pull/8810/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
int.rs https://github.com/RustPython/RustPython/pull/8810/files#diff-6f6fb35904d4bdd7481e9d90622e7fc41a1eff225053e762f724150581464887
os.rs https://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
crates/derive-impl/src/from_args.rshttps://github.com/RustPython/RustPython/pull/8810/files#diff-90c094cca198d94b0145e4a485172fba68de5c77f49fcd05a6b882896721f1c9
View file https://github.com/youknowone/RustPython/blob/770c38169f53b98a296948711651fb1d53bfcb90/crates/derive-impl/src/from_args.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8810/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8810/files#diff-90c094cca198d94b0145e4a485172fba68de5c77f49fcd05a6b882896721f1c9
https://github.com/RustPython/RustPython/pull/8810/files#diff-90c094cca198d94b0145e4a485172fba68de5c77f49fcd05a6b882896721f1c9
crates/vm/src/builtins/builtin_func.rshttps://github.com/RustPython/RustPython/pull/8810/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
View file https://github.com/youknowone/RustPython/blob/770c38169f53b98a296948711651fb1d53bfcb90/crates/vm/src/builtins/builtin_func.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8810/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8810/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
https://github.com/RustPython/RustPython/pull/8810/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
crates/vm/src/builtins/int.rshttps://github.com/RustPython/RustPython/pull/8810/files#diff-6f6fb35904d4bdd7481e9d90622e7fc41a1eff225053e762f724150581464887
View file https://github.com/youknowone/RustPython/blob/770c38169f53b98a296948711651fb1d53bfcb90/crates/vm/src/builtins/int.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8810/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8810/files#diff-6f6fb35904d4bdd7481e9d90622e7fc41a1eff225053e762f724150581464887
https://github.com/RustPython/RustPython/pull/8810/files#diff-6f6fb35904d4bdd7481e9d90622e7fc41a1eff225053e762f724150581464887
https://github.com/RustPython/RustPython/pull/8810/files#diff-6f6fb35904d4bdd7481e9d90622e7fc41a1eff225053e762f724150581464887
https://github.com/RustPython/RustPython/pull/8810/files#diff-6f6fb35904d4bdd7481e9d90622e7fc41a1eff225053e762f724150581464887
crates/vm/src/stdlib/os.rshttps://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
View file https://github.com/youknowone/RustPython/blob/770c38169f53b98a296948711651fb1d53bfcb90/crates/vm/src/stdlib/os.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8810/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
https://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
coderabbitaihttps://github.com/apps/coderabbitai
Sep 24, 2026https://github.com/RustPython/RustPython/pull/8810/files#r4093830653
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8810/files
https://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
https://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
https://github.com/RustPython/RustPython/pull/8810/files#diff-3a1b2246dc47369778bf6889ee62be670eee468a599dee319ca981ead50d686a
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8810/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.