GeezerVison is showing github.com — Match SymbolTable repr with CPython format by moreal · Pull Request #7139 · RustPython/RustPython
Conversation
moreal
commented
Feb 14, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary by CodeRabbit
- Improvements
- Symbol table objects now display with detailed information (table name, object ID, and line number) when printed in the Python REPL or error messages.
- Updated symbol table class identifier for clarity.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Feb 14, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
📝 Walkthrough
Walkthrough
The pull request modifies symtable.rs to add Python-level representation support for PySymbolTable. It imports Representable, changes the exported class name from "SymbolTable" to "symtable entry", decorates the class with with(Representable), and implements a custom repr_str method for formatted output.
Changes
| Cohort / File(s) |
Summary |
Symbol Table Representation crates/vm/src/stdlib/symtable.rs |
Added imports (Py, types::Representable), renamed pyclass from "SymbolTable" to "symtable entry", added with(Representable) to pyclass attribute, and implemented Representable trait with custom repr formatting including class name, table name, object id, and line number. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- RustPython/RustPython#6048: Modifies the same
PySymbolTable type with API/property refactoring while this PR changes its representation and class naming.
Suggested reviewers
Poem
🐰 A symbol table dressed in new attire,
With symtable entry and repr to inspire,
Hops through the code with representable flair,
Displaying its essence with formatting care! ✨
🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
⚠️ Warning |
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
| Merge Conflict Detection |
⚠️ Warning |
❌ Merge conflicts detected (29 files):
⚔️ .github/workflows/upgrade-pylib.md (content) ⚔️ Cargo.lock (content) ⚔️ Lib/collections/__init__.py (content) ⚔️ Lib/hashlib.py (content) ⚔️ Lib/test/test_collections.py (content) ⚔️ Lib/test/test_hashlib.py (content) ⚔️ Lib/test/test_hmac.py (content) ⚔️ Lib/test/test_inspect/test_inspect.py (content) ⚔️ Lib/test/test_keywordonlyarg.py (content) ⚔️ Lib/test/test_positional_only_arg.py (content) ⚔️ Lib/test/test_re.py (content) ⚔️ Lib/test/test_smtplib.py (content) ⚔️ Lib/test/test_struct.py (content) ⚔️ Lib/test/test_symtable.py (content) ⚔️ Lib/test/test_ucn.py (content) ⚔️ Lib/test/test_unicodedata.py (content) ⚔️ Lib/test/test_urlparse.py (content) ⚔️ crates/codegen/src/compile.rs (content) ⚔️ crates/stdlib/Cargo.toml (content) ⚔️ crates/stdlib/src/blake2.rs (content) ⚔️ crates/stdlib/src/hashlib.rs (content) ⚔️ crates/stdlib/src/md5.rs (content) ⚔️ crates/stdlib/src/sha1.rs (content) ⚔️ crates/stdlib/src/sha256.rs (content) ⚔️ crates/stdlib/src/sha3.rs (content) ⚔️ crates/stdlib/src/sha512.rs (content) ⚔️ crates/stdlib/src/unicodedata.rs (content) ⚔️ crates/vm/src/stdlib/symtable.rs (content) ⚔️ crates/vm/src/vm/mod.rs (content)
These conflicts must be resolved before merging into main. |
Resolve conflicts locally and push changes to this branch. |
✅ Passed checks (2 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
✅ Passed |
The title 'Match SymbolTable repr with CPython format' accurately describes the main change, which is implementing a Representable trait for PySymbolTable to align its string representation with CPython's format. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
- Auto-commit resolved conflicts to branch
fix/fail-symtable-test_symtable_entry_repr
- Post resolved changes as copyable diffs in a comment
No actionable comments were generated in the recent review. 🎉
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
📦 Library Dependencies
The following Lib/ modules were modified. Here are their dependencies:
[ ] lib: cpython/Lib/hashlib.py
[ ] test: cpython/Lib/test/test_hashlib.py (TODO: 9)
dependencies:
dependent tests: (15 tests)
- hashlib: test_hashlib test_hmac test_smtplib test_tarfile test_unicodedata test_urllib2_localnet
- urllib.request: test_http_cookiejar test_pathlib test_pydoc test_site test_ssl test_urllib test_urllib2 test_urllib2net test_urllibnet
[x] lib: cpython/Lib/symtable.py
[ ] test: cpython/Lib/test/test_symtable.py (TODO: 17)
dependencies:
dependent tests: (1 tests)
Legend:
[+] path exists in CPython
[x] up-to-date, [ ] outdated
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
#[pyattr]
|
|
|
#[pyclass(name = "SymbolTable")]
|
|
|
#[pyclass(name = "symtable entry")]
|
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.
SymbolTable itself is not an entry, is this correct?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|