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 — Fix __build_class__ compatibility by youknowone · Pull Request #6308 · RustPython/RustPython

Conversation

@youknowone

@youknowone youknowone commented Nov 29, 2025 •
edited by coderabbitai Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Refactor
    • Improved class creation and metaclass resolution handling
    • Updated error messages related to class instantiation

✏️ Tip: You can customize this high-level summary in your review settings.

Sorry, something went wrong.

Uh oh!

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

All reactions
@youknowone
Update __build_class__
94a1903
@coderabbitai

coderabbitai Bot commented Nov 29, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • Lib/test/test_descr.py is excluded by !Lib/**
  • Lib/test/test_super.py is excluded by !Lib/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The __build_class__ function's public signature in crates/vm/src/stdlib/builtins.rs was updated to use a name parameter instead of qualified_name. Internal logic was refactored to derive the Python class name object directly from the new parameter, along with adjustments to metaclass resolution and argument construction.

Changes

Cohort / File(s) Summary
__build_class__ signature and implementation
crates/vm/src/stdlib/builtins.rs
Parameter renamed from qualified_name: PyStrRef to name: PyStrRef; internal logic adjusted to use the new parameter for class name propagation; metaclass resolution, argument construction, and __classcell__ checks refactored

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that all internal uses of the renamed parameter work correctly across metaclass resolution and class construction logic
  • Check that callers of __build_class__ are updated to pass the correct parameter
  • Confirm the __classcell__ check logic remains valid with the new parameter

Possibly related PRs

  • __type_params__ in __build_class__ #5883: Also modifies __build_class__ implementation to add handling for .type_params / __type_params__ in the same file.

Poem

🐰 A class by any other name still builds true,
No more qualified names to confuse or construe,
With name so simple, the logic flows clean,
The metaclass knows just what we mean! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix build_class compatibility' directly references the specific function being modified and indicates the nature of the change (a compatibility fix), which aligns with the actual modifications to the build_class function signature and internal implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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 and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

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

@youknowone
youknowone marked this pull request as ready for review November 29, 2025 01:58
@youknowone
fix test
cf3e257
@youknowone
youknowone force-pushed the build-class branch from d6c3bd7 to cf3e257 Compare November 29, 2025 02:22
@youknowone
youknowone merged commit 95b8c60 into RustPython:main Nov 29, 2025
13 checks passed

Uh oh!

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

@youknowone
youknowone deleted the build-class branch November 29, 2025 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

1 participant

@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 01402503 — 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.