| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -121,6 +121,7 @@ | |
| "sysmodule", | ||
| "tracebacks", | ||
| "typealiases", | ||
| "typevartuples", | ||
| "unhashable", | ||
| "uninit", | ||
| "unraisable", | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1120
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1805
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 2865
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 5821
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 772
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 121
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 3837
Add empty-string check after stripping leading underscores from class name.
When class_name consists entirely of underscores (e.g., "__" or "___"), trim_start_matches('_') produces an empty string. CPython's mangling logic skips mangling in this case, but the current code proceeds to produce an incorrect mangled name.
For example, class __: with a method def __foo(self): should remain __foo (unmangled), not become ___foo.
Proposed fix// Strip leading underscores from class name let class_name = class_name.trim_start_matches('_'); + if class_name.is_empty() { + return name.into(); + } let mut ret = String::with_capacity(1 + class_name.len() + name.len());In `@crates/codegen/src/symboltable.rs` around lines 2638 - 2639, After trimming leading underscores from class_name (let class_name = class_name.trim_start_matches('_');), add a check for an empty result and skip mangling if empty: if class_name.is_empty() { return original_name.to_string(); } so that classes made only of underscores (e.g., "__") do not trigger private-name mangling; update the code path that builds the mangled identifier to return the unmodified identifier when class_name is empty.Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.