René's URL Explorer Experiment


Title: Reject unsupported native keywords before argument binding by widehyo1 · Pull Request #8957 · RustPython/RustPython · GitHub

Open Graph Title: Reject unsupported native keywords before argument binding by widehyo1 · Pull Request #8957 · RustPython/RustPython

X Title: Reject unsupported native keywords before argument binding by widehyo1 · Pull Request #8957 · RustPython/RustPython

Description: This PR follows our AI policy Summary Reject unsupported keyword arguments before native argument binding and conversion, matching CPython's dispatch order. For example, id(obj=1) now raises TypeError: id() takes no keyword arguments instead of a positional argument binding error. The existing id(1, **{'foo': 1}) doctest in test_extcall now passes, so remove its TODO and EXPECTED_FAILURE marker without changing the call or expected output. Details Derive KeywordDispatch policies at registration time from FromArgs::PARAMS for macro-registered functions and methods, including nested parameter metadata, without explicit no_keywords annotations. This policy is independent of flags inferred from Rust signatures. Forward keyword-capable arguments to the binder. Raw FuncArgs functions such as min and max retain validation in their function bodies. Check nonempty kwargs/kwnames before binding and conversion. Unbound method descriptors first validate positional self presence and type. Empty keyword dictionaries remain accepted. Derive C-API policies from actual ml_flags, including the unqualified diagnostic name used by legacy METH_VARARGS functions. Preserve the original dynamic registration argument order and add a keyword_dispatch argument to Context::new_method_def. Reuse SimpleItemMeta for function attributes and remove the redundant FunctionItemMeta type. Consolidate Python behavior regressions in extra_tests/snippets/syntax_function_args.py, plus a C-API regression for keyword rejection before NOARGS arity validation. Automatic keyword dispatch applies to macro-registered functions and methods. Constructors, slot wrappers, and keyword-capable parsers are not rewritten. Positional-only arity diagnostics are outside this change. Context::new_method_def now takes (name, callable, flags, doc, keyword_dispatch); embedding callers using the previous signature need to supply the new policy argument. Direct PyMethodDef struct initializers also need the new keyword_dispatch field. Testing Latest validation: temp/extcall/validation/inference-20261006-072918/. Passed: Workspace tests and C-API tests (cargo test from crates/capi). Workspace and C-API Clippy with the separate C-API configuration. cargo check -p rustpython-vm --no-default-features. Consolidated keyword regressions in syntax_function_args.py on RustPython and through the CPython/RustPython snippet harness. test_call, test_extcall, test_builtin, and test_list via the release interpreter: 402 tests run, 198 skipped; all four modules passed. cargo fmt --all --check and git diff --check. The full extra_tests pytest run reported 477 passed, 7 failed. Six failures were on CPython (builtin_memoryview, builtin_signature, stdlib_atexit, stdlib_gc, stdlib_struct, and stdlib_unicode_shared). The RustPython failure was stdlib_sqlite: _sqlite3 was unavailable in the default build. The consolidated keyword regressions passed on both interpreters. AI assistance: Codex:GPT-6 Summary by CodeRabbit Bug Fixes Built-in functions and methods now consistently reject unsupported keyword arguments with clearer errors. Method calls now require a positional instance argument, preventing calls that omit self. Improved argument validation and error precedence across built-in functions, while preserving supported keyword handling.

Open Graph Description: This PR follows our AI policy Summary Reject unsupported keyword arguments before native argument binding and conversion, matching CPython's dispatch order. For example, id(obj=1) now raises T...

X Description: This PR follows our AI policy Summary Reject unsupported keyword arguments before native argument binding and conversion, matching CPython's dispatch order. For example, id(obj=1) now rais...

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

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:e56ac9ff-2605-c632-401e-955a3287e618
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBC50:E0ADF:1100EBE:157CD50:6B01FE1C
html-safe-noncef2ade011fa07fb5279964a46da0996cff427f6dbbcc7a93386c942e0e2bb4bf0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzUwOkUwQURGOjExMDBFQkU6MTU3Q0Q1MDo2QjAxRkUxQyIsInZpc2l0b3JfaWQiOiI5NjE5NDA4NTkyNTgwMTExNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac009b45110d019b2a7fd3bff37658ccc21d2d23223f3fbc516b3341e9236ebb6a
hovercard-subject-tagpull_request:4734238183
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/8957/files
twitter:imagehttps://avatars.githubusercontent.com/u/87641474?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/87641474?s=400&v=4
og:image:altThis PR follows our AI policy Summary Reject unsupported keyword arguments before native argument binding and conversion, matching CPython's dispatch order. For example, id(obj=1) now raises T...
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/8957/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F8957%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%2F8957%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/8957/files
Reloadhttps://github.com/RustPython/RustPython/pull/8957/files
Reloadhttps://github.com/RustPython/RustPython/pull/8957/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
widehyo1:fix/native-keyword-dispatchhttps://github.com/widehyo1/RustPython/tree/fix/native-keyword-dispatch
Conversation 18 https://github.com/RustPython/RustPython/pull/8957
Commits 4 https://github.com/RustPython/RustPython/pull/8957/commits
Checks 20 https://github.com/RustPython/RustPython/pull/8957/checks
Files changed https://github.com/RustPython/RustPython/pull/8957/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8957/files
Reject unsupported native keywords before argument binding https://github.com/RustPython/RustPython/pull/8957/files#top
Show all changes 4 commits https://github.com/RustPython/RustPython/pull/8957/files
dcb72df Reject unsupported native keywords before argument binding widehyo1 Oct 4, 2026 https://github.com/RustPython/RustPython/pull/8957/commits/dcb72df459cc43341df0f0e9e6d6ad46c15a18c3
4575883 Infer native keyword dispatch from argument metadata widehyo1 Oct 4, 2026 https://github.com/RustPython/RustPython/pull/8957/commits/4575883f447fbfdb6314227d6fc96a2136391b59
f4cc07f Simplify native function registration metadata widehyo1 Oct 6, 2026 https://github.com/RustPython/RustPython/pull/8957/commits/f4cc07febb1b50a2237aef463448e711b1e77433
d8469d3 Reject native keywords by calling convention flags youknowone Oct 8, 2026 https://github.com/RustPython/RustPython/pull/8957/commits/d8469d3a574d1a7f168fc429927592499395853e
Clear filters https://github.com/RustPython/RustPython/pull/8957/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8957/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8957/files
test_extcall.py https://github.com/RustPython/RustPython/pull/8957/files#diff-007057246211e6316535b427bd7b5ed8c03963bff25e4f2931b0168f50dbc594
methodobject.rs https://github.com/RustPython/RustPython/pull/8957/files#diff-913609e56f901c63c8e8ef250f7583d583bc35cb30b85c064ecc1125fb27366a
builtin_func.rs https://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
descriptor.rs https://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
syntax_function_args.py https://github.com/RustPython/RustPython/pull/8957/files#diff-afa7b393d69f941ddea93f27530d5f65ac9458916522d009eee896acc3a6083a
Lib/test/test_extcall.pyhttps://github.com/RustPython/RustPython/pull/8957/files#diff-007057246211e6316535b427bd7b5ed8c03963bff25e4f2931b0168f50dbc594
View file https://github.com/widehyo1/RustPython/blob/d8469d3a574d1a7f168fc429927592499395853e/Lib/test/test_extcall.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8957/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8957/files#diff-007057246211e6316535b427bd7b5ed8c03963bff25e4f2931b0168f50dbc594
https://github.com/RustPython/RustPython/pull/8957/files#diff-007057246211e6316535b427bd7b5ed8c03963bff25e4f2931b0168f50dbc594
crates/capi/src/methodobject.rshttps://github.com/RustPython/RustPython/pull/8957/files#diff-913609e56f901c63c8e8ef250f7583d583bc35cb30b85c064ecc1125fb27366a
View file https://github.com/widehyo1/RustPython/blob/d8469d3a574d1a7f168fc429927592499395853e/crates/capi/src/methodobject.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8957/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8957/files#diff-913609e56f901c63c8e8ef250f7583d583bc35cb30b85c064ecc1125fb27366a
crates/vm/src/builtins/builtin_func.rshttps://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
View file https://github.com/widehyo1/RustPython/blob/d8469d3a574d1a7f168fc429927592499395853e/crates/vm/src/builtins/builtin_func.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8957/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
https://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
https://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
https://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
https://github.com/RustPython/RustPython/pull/8957/files#diff-3803ec9c4612463addd109dc797e558433c26a49228b43b3963ec1d4c3cfebe8
crates/vm/src/builtins/descriptor.rshttps://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
View file https://github.com/widehyo1/RustPython/blob/d8469d3a574d1a7f168fc429927592499395853e/crates/vm/src/builtins/descriptor.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8957/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
https://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
https://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
https://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
https://github.com/RustPython/RustPython/pull/8957/files#diff-7c8850ad317bf0c33b339610ec3e80a4038cd37545ba20746f8e680d87931b8e
extra_tests/snippets/syntax_function_args.pyhttps://github.com/RustPython/RustPython/pull/8957/files#diff-afa7b393d69f941ddea93f27530d5f65ac9458916522d009eee896acc3a6083a
View file https://github.com/widehyo1/RustPython/blob/d8469d3a574d1a7f168fc429927592499395853e/extra_tests/snippets/syntax_function_args.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/8957/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/8957/files#diff-afa7b393d69f941ddea93f27530d5f65ac9458916522d009eee896acc3a6083a
Please reload this pagehttps://github.com/RustPython/RustPython/pull/8957/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.