René's URL Explorer Experiment


Title: Malformed builtin __text_signature__ makes inspect.signature(len/sorted/open) raise ValueError · Issue #8383 · RustPython/RustPython · GitHub

Open Graph Title: Malformed builtin __text_signature__ makes inspect.signature(len/sorted/open) raise ValueError · Issue #8383 · RustPython/RustPython

X Title: Malformed builtin __text_signature__ makes inspect.signature(len/sorted/open) raise ValueError · Issue #8383 · RustPython/RustPython

Description: Summary inspect.signature() fails on common builtins (len, sorted, open, …) with ValueError: <...> builtin has invalid signature, where CPython returns a proper Signature. The cause is that the auto-generated __text_signature__ values ar...

Open Graph Description: Summary inspect.signature() fails on common builtins (len, sorted, open, …) with ValueError: <...> builtin has invalid signature, where CPython returns a proper Signature. The cause is that the aut...

X Description: Summary inspect.signature() fails on common builtins (len, sorted, open, …) with ValueError: <...> builtin has invalid signature, where CPython returns a proper Signature. The cause is that t...

Opengraph URL: https://github.com/RustPython/RustPython/issues/8383

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Malformed builtin __text_signature__ makes inspect.signature(len/sorted/open) raise ValueError","articleBody":"## Summary\n\n`inspect.signature()` fails on common builtins (`len`, `sorted`, `open`, …) with `ValueError: \u003c...> builtin has invalid signature`, where CPython returns a proper `Signature`. The cause is that the auto-generated `__text_signature__` values are malformed: they expose the Rust parameter names and omit the positional-only (`/`) and keyword-only (`*`) markers, so they are either rejected by `inspect` or semantically wrong.\n\n## Reproduction\n\n```python\nimport inspect\nprint(inspect.signature(len))\n# RustPython: ValueError: \u003cbuilt-in function len> builtin has invalid signature\n# CPython:    (obj, /)\n```\n\nSame `ValueError` for `inspect.signature(sorted)` and `inspect.signature(open)`.\n\nThe underlying `__text_signature__` strings:\n\n| callable | RustPython | CPython 3.14 |\n|---|---|---|\n| `len` | `'($module, obj)'` | `'($module, obj, /)'` |\n| `abs` | `'($module, x)'` | `'($module, x, /)'` |\n| `sorted` | `'($module, iterable, opts)'` | `'($module, iterable, /, *, key=None, reverse=False)'` |\n| `open` | `'($module, args)'` | full signature with defaults |\n| `iter` | `'($module, iter_target, sentinel)'` | `None` |\n\nRustPython actually populates `__text_signature__` for *more* builtins than CPython, but the values are generated from the Rust function's parameters (`opts`, `args`, `iter_target`, …) and lack the `/` / `*` separators, so:\n\n- `inspect.signature` raises `ValueError` instead of returning a signature, and\n- where it would parse, the signature is wrong (e.g. `sorted` would show `(iterable, opts)` rather than `(iterable, /, *, key=None, reverse=False)`).\n\n## Context\n\nThis is a follow-up to #2410 (\"Builtin functions and methods lack a `.__text_signature__` property\"), which is closed — the attribute now exists, but its values do not match CPython and break `inspect.signature`.\n\nProducing fully accurate signatures for every builtin is a large effort (CPython hand-authors them via Argument Clinic), so a reasonable minimum would be that `inspect.signature()` returns *something* usable (or raises the same way CPython does for genuinely signature-less builtins) rather than `ValueError` on `len`/`sorted`/`open`.\n\n## Reference\n\nVerified against CPython 3.14.5.\n\n---\n\n*Investigated and drafted by Claude; reviewed before filing.*\n","author":{"url":"https://github.com/youknowone","@type":"Person","name":"youknowone"},"datePublished":"2026-07-26T07:23:35Z","url":"https://github.com/RustPython/RustPython/issues/8383"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:031b4436-c982-6b6c-90df-045ea44d6c9e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAA2E:3E4205:33A9B9C:45041F7:6B0201F1
html-safe-nonce0d98cc369c3a2c2a607a508107d2499f9b18e41a7391916ce04c64f149695c0c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTJFOjNFNDIwNTozM0E5QjlDOjQ1MDQxRjc6NkIwMjAxRjEiLCJ2aXNpdG9yX2lkIjoiNjYyMDQ1NTc2NjU5Mzc2NTg3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac417830bfbedc82183e48a8aef45ad6f33f1ad02b36700b515c4c7d606349726f
hovercard-subject-tagissue:4979577932
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/RustPython/RustPython/8383/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d95ff0e8911c7dca4cb696293997407f7207d8b6556b2b9e172fbddf60166f41/RustPython/RustPython/issues/8383
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d95ff0e8911c7dca4cb696293997407f7207d8b6556b2b9e172fbddf60166f41/RustPython/RustPython/issues/8383
og:image:altSummary inspect.signature() fails on common builtins (len, sorted, open, …) with ValueError: <...> builtin has invalid signature, where CPython returns a proper Signature. The cause is that the aut...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameyouknowone
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
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
disable-turbofalse
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
react-app-nameissues

Links:

Skip to contenthttps://github.com/RustPython/RustPython/issues/8383#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fissues%2F8383
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%2Fissues%2F8383
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/issues/8383
Reloadhttps://github.com/RustPython/RustPython/issues/8383
Reloadhttps://github.com/RustPython/RustPython/issues/8383
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
https://github.com/RustPython/RustPython
New issuehttps://github.com/login?return_to=https://github.com/RustPython/RustPython/issues/8383
New issuehttps://github.com/login?return_to=https://github.com/RustPython/RustPython/issues/8383
#8968https://github.com/RustPython/RustPython/pull/8968
Malformed builtin __text_signature__ makes inspect.signature(len/sorted/open) raise ValueErrorhttps://github.com/RustPython/RustPython/issues/8383#top
#8968https://github.com/RustPython/RustPython/pull/8968
https://github.com/leehanjeong
C-compatA discrepancy between RustPython and CPythonhttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22C-compat%22
z-ca-2026Tag to track Contribution Academy 2026https://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22z-ca-2026%22
https://github.com/youknowone
youknowonehttps://github.com/youknowone
on Jul 26, 2026https://github.com/RustPython/RustPython/issues/8383#issue-4979577932
#2410https://github.com/RustPython/RustPython/issues/2410
youknowonehttps://github.com/youknowone
C-compatA discrepancy between RustPython and CPythonhttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22C-compat%22
on Jul 26, 2026https://github.com/RustPython/RustPython/issues/8383#event-28493654138
https://github.com/leehanjeong
leehanjeonghttps://github.com/leehanjeong
on Jul 26, 2026https://github.com/RustPython/RustPython/issues/8383#issuecomment-5082615630
github-actionshttps://github.com/apps/github-actions
leehanjeonghttps://github.com/leehanjeong
on Jul 26, 2026https://github.com/RustPython/RustPython/issues/8383#event-28494072260
morealhttps://github.com/moreal
z-ca-2026Tag to track Contribution Academy 2026https://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22z-ca-2026%22
on Jul 26, 2026https://github.com/RustPython/RustPython/issues/8383#event-28494227767
https://github.com/leehanjeong
leehanjeonghttps://github.com/leehanjeong
on Aug 2, 2026https://github.com/RustPython/RustPython/issues/8383#issuecomment-5155211807
#8390https://github.com/RustPython/RustPython/pull/8390
youknowonehttps://github.com/youknowone
completedhttps://github.com/RustPython/RustPython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#8968https://github.com/RustPython/RustPython/pull/8968
on Oct 5, 2026https://github.com/RustPython/RustPython/issues/8383#event-32521042955
Sign up for freehttps://github.com/signup?return_to=https://github.com/RustPython/RustPython/issues/8383
Sign in to commenthttps://github.com/login?return_to=https://github.com/RustPython/RustPython/issues/8383
leehanjeonghttps://github.com/leehanjeong
C-compatA discrepancy between RustPython and CPythonhttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22C-compat%22
z-ca-2026Tag to track Contribution Academy 2026https://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22z-ca-2026%22
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.