GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Expose symbol scopes through _symtable by YangSiJun528 · Pull Request #8538 · RustPython/RustPython

Conversation

@YangSiJun528

@YangSiJun528 YangSiJun528 commented Aug 16, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • This PR follows our AI policy

Summary

_symtable omitted symbol scope information, causing Lib/symtable.py to report incorrect globals, locals, and free variables.

Expose the missing scope information so the public symtable API returns CPython-compatible results.

Testing

  • cargo run --release -- -m test test_symtable

AI assistance

Codex (GPT-5) was used to investigate and implement this change.
I reviewed and validated all AI-assisted work.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected symbol table results to include both symbol flags and scope information.
    • Improved the accuracy of symbol metadata returned to callers.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@YangSiJun528
Expose symbol scopes through _symtable
62dd3ca
Pack symbol scopes with definition flags in _symtable.symbols for
Lib/symtable.py.

Assisted-by: Codex:gpt-5
@github-actions github-actions Bot added the z-ca-2026 Tag to track Contribution Academy 2026 label Aug 16, 2026
@github-actions github-actions Bot assigned YangSiJun528 Aug 16, 2026
@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3aa4bb6f-4909-448f-8395-028131f51fec

📥 Commits

Reviewing files that changed from the base of the PR and between aaeab4f and 62dd3ca.

⛔ Files ignored due to path filters (1)
  • Lib/test/test_symtable.py is excluded by !Lib/**
📒 Files selected for processing (1)
  • crates/vm/src/stdlib/_symtable.rs

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

PySymbolTable.symbols now returns symbol flags combined with the symbol scope shifted by SCOPE_OFFSET.

Changes

Symbol scope encoding

Layer / File(s) Summary
Encode symbol scope values
crates/vm/src/stdlib/_symtable.rs
PySymbolTable.symbols combines each symbol’s flag bits with its shifted scope classification.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 62dd3

This is a localized behavior fix with no actionable merge-blocking risk remaining; merge after normal formatting and lint checks.

Possibly related PRs

  • RustPython/RustPython#8309: Both changes modify PySymbolTable.symbols in _symtable.rs.

Suggested reviewers: shaharnaveh, youknowone

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exposing symbol scopes through _symtable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[x] lib: cpython/Lib/symtable.py
[x] test: cpython/Lib/test/test_symtable.py (TODO: 5)

dependencies:

  • symtable

dependent tests: (2 tests)

  • symtable: test_inspect test_symtable

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ShaharNaveh
ShaharNaveh approved these changes Aug 16, 2026
View reviewed changes

@ShaharNaveh ShaharNaveh left a comment

Copy link
Copy Markdown
Contributor

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.

🔥

ty for looking into it:)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@youknowone
youknowone merged commit 25e76af into RustPython:main Aug 17, 2026
29 checks passed

Uh oh!

There was an error while loading. Please reload this page.

youknowone pushed a commit that referenced this pull request Sep 16, 2026
@YangSiJun528
Expose symbol scopes through _symtable (#8538)
cd935b8
Pack symbol scopes with definition flags in _symtable.symbols for
Lib/symtable.py.

Assisted-by: Codex:gpt-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ShaharNaveh ShaharNaveh ShaharNaveh approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@YangSiJun528 YangSiJun528

Labels

z-ca-2026 Tag to track Contribution Academy 2026

Projects

None yet

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.

3 participants

@YangSiJun528 @ShaharNaveh @youknowone
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.