8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f17d28 commit 205273bCopy full SHA for 205273b
vm/src/builtins/object.rs
@@ -262,11 +262,19 @@ impl PyBaseObject {
262
}
263
264
#[pyslot]
265
- #[pymethod(magic)]
266
- fn init(_zelf: PyObjectRef, _args: FuncArgs, _vm: &VirtualMachine) -> PyResult<()> {
+ fn slot_init(_zelf: PyObjectRef, _args: FuncArgs, _vm: &VirtualMachine) -> PyResult<()> {
267
Ok(())
268
269
+ #[pymethod(magic)]
270
+ fn init(zelf: PyObjectRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> {
271
+ let init = zelf
272
+ .class()
273
+ .mro_find_map(|cls| cls.slots.init.load())
274
+ .unwrap();
275
+ (init)(zelf, args, vm)
276
+ }
277
+
278
#[pygetset(name = "__class__")]
279
fn get_class(obj: PyObjectRef) -> PyTypeRef {
280
obj.class().to_owned()
0 commit comments