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 — Reorder PyNumberBinaryOp to match NB_* constants by youknowone · Pull Request #7512 · RustPython/RustPython

Conversation

@youknowone

@youknowone youknowone commented Mar 27, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Align variant ordering with BinaryOperator enum and CPython's NB_* constants from opcode.h. Divmod is placed last as it has no corresponding NB_* constant.

Summary by CodeRabbit

  • Chores
    • Internal code reorganization to align with Python conventions. No user-facing changes.

Sorry, something went wrong.

Uh oh!

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

All reactions
@youknowone
Reorder PyNumberBinaryOp to match NB_* constants
5c80cee
Align variant ordering with BinaryOperator enum and
CPython's NB_* constants from opcode.h. Divmod is placed
last as it has no corresponding NB_* constant.
@coderabbitai

coderabbitai Bot commented Mar 27, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 9f24d04b-66eb-42b1-8b0c-fac239474a3c

📥 Commits

Reviewing files that changed from the base of the PR and between 9282a87 and 5c80cee.

📒 Files selected for processing (1)
  • crates/vm/src/protocol/number.rs

📝 Walkthrough

Walkthrough

Reorders variants in the PyNumberBinaryOp enum to align with the NB_* constants ordering from opcode.h. This is a structural reorganization of enum variant sequence without functional changes to existing methods.

Changes

Cohort / File(s) Summary
Enum Variant Reordering
crates/vm/src/protocol/number.rs
Reordered PyNumberBinaryOp enum variants including Add, Subtract, Multiply, Remainder, And, FloorDivide, Lshift, MatrixMultiply, Or, Rshift, TrueDivide, Xor, Divmod and their corresponding Inplace* variants to match NB_* constants ordering from opcode.h. No functional changes to methods.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Unify BINARY_OP bytecodes #6317: Directly related enum variant reordering to align operator discriminants with unified NB_* and bytecode-level BinaryOp ordering.

Poem

🐰 Hop, hop! The operators dance in line,
Now sorted like opcode.h does design,
No logic bent, just variants rearranged,
Order brings harmony, all has changed! 📋✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 accurately summarizes the main change: reordering the PyNumberBinaryOp enum to match NB_* constants from opcode.h, which is the primary objective of the pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 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 March 27, 2026 01:54
@youknowone
youknowone merged commit a91127c into RustPython:main Mar 27, 2026
15 checks passed

Uh oh!

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

@youknowone
youknowone deleted the nb-slots branch March 27, 2026 03:41
youknowone added a commit that referenced this pull request Sep 16, 2026
@youknowone
Reorder PyNumberBinaryOp to match NB_* constants (#7512)
67e3e4b
Align variant ordering with BinaryOperator enum and
CPython's NB_* constants from opcode.h. Divmod is placed
last as it has no corresponding NB_* constant.
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.