Skip to content

Commit 2f297e4

Browse files
youknowoneclaude
andcommitted
slots: remove duplicate #[pymethod] from descriptors and fix io.rs
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 726c4f5 commit 2f297e4

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

crates/vm/src/builtins/getset.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ impl PyGetSet {
118118
)))
119119
}
120120
}
121-
#[pymethod]
122121
fn __set__(
123122
zelf: PyObjectRef,
124123
obj: PyObjectRef,
@@ -127,7 +126,7 @@ impl PyGetSet {
127126
) -> PyResult<()> {
128127
Self::descr_set(&zelf, obj, PySetterValue::Assign(value), vm)
129128
}
130-
#[pymethod]
129+
131130
fn __delete__(zelf: PyObjectRef, obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
132131
Self::descr_set(&zelf, obj, PySetterValue::Delete, vm)
133132
}

crates/vm/src/builtins/property.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ impl PyProperty {
125125
}
126126
}
127127
}
128-
#[pymethod]
129128
fn __set__(
130129
zelf: PyObjectRef,
131130
obj: PyObjectRef,
@@ -134,7 +133,7 @@ impl PyProperty {
134133
) -> PyResult<()> {
135134
Self::descr_set(&zelf, obj, PySetterValue::Assign(value), vm)
136135
}
137-
#[pymethod]
136+
138137
fn __delete__(zelf: PyObjectRef, obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
139138
Self::descr_set(&zelf, obj, PySetterValue::Delete, vm)
140139
}

crates/vm/src/exception_group.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ pub(super) mod types {
202202
)))
203203
}
204204

205-
#[pymethod]
206-
fn __repr__(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyStrRef> {
207-
Self::slot_repr(&zelf, vm)
208-
}
209-
210205
#[pyslot]
211206
fn slot_repr(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyStrRef> {
212207
let zelf = zelf

crates/vm/src/stdlib/io.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,8 @@ mod _io {
16161616
let (raw, BufferSize { buffer_size }): (PyObjectRef, _) =
16171617
args.bind(vm).map_err(|e| {
16181618
let str_repr = e
1619-
.__str__(vm)
1619+
.as_object()
1620+
.str(vm)
16201621
.map(|s| s.as_str().to_owned())
16211622
.unwrap_or_else(|_| "<error getting exception str>".to_owned());
16221623
let msg = format!("{}() {}", Self::CLASS_NAME, str_repr);

0 commit comments

Comments
 (0)