Skip to content

Commit 025c248

Browse files
committed
unify slots
1 parent 33c01b9 commit 025c248

File tree

3 files changed

+1112
-976
lines changed

3 files changed

+1112
-976
lines changed

crates/vm/src/protocol/number.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ pub struct PyNumberSlots {
256256
pub int: AtomicCell<Option<PyNumberUnaryFunc>>,
257257
pub float: AtomicCell<Option<PyNumberUnaryFunc>>,
258258

259+
// Right variants (internal - not exposed in SlotAccessor)
259260
pub right_add: AtomicCell<Option<PyNumberBinaryFunc>>,
260261
pub right_subtract: AtomicCell<Option<PyNumberBinaryFunc>>,
261262
pub right_multiply: AtomicCell<Option<PyNumberBinaryFunc>>,
@@ -295,8 +296,7 @@ pub struct PyNumberSlots {
295296

296297
impl From<&PyNumberMethods> for PyNumberSlots {
297298
fn from(value: &PyNumberMethods) -> Self {
298-
// right_* functions will use the same left function as PyNumberMethods
299-
// allows both f(self, other) and f(other, self)
299+
// right_* slots use the same function as left ops for native types
300300
Self {
301301
add: AtomicCell::new(value.add),
302302
subtract: AtomicCell::new(value.subtract),

0 commit comments

Comments
 (0)