curved-television-6568
05/23/2024, 10:22 AMbitter-ability-32190
05/23/2024, 11:03 AMobject and actually call __getattribute on it (and not self?)curved-television-6568
05/23/2024, 11:05 AMobject? (I get your idea, but I've no clue how to do that.. ðŽ )curved-television-6568
05/23/2024, 11:06 AMbitter-ability-32190
05/23/2024, 11:06 AMlet obj = py.import("builtins")?.get("object")?;curved-television-6568
05/23/2024, 11:06 AMfn __getattribute__(
self_: &PyCell<Self>,
name: String,
py: Python,
) -> PyResult<*mut ffi::PyObject> {
if name == "default" {
if let Some(_default) = &self_.extract::<Self>()?.default {
//if let Some(_default) = &self.default {
// panic!("in get default, with default!")
}
// panic!("in get default, without default!")
}
unsafe {
let slf = self_.borrow_mut().into_ptr();
let attr = name.into_py(py).into_ptr();
let res = ffi::PyObject_GenericGetAttr(slf, attr);
if res.is_null() {
Err(PyErr::fetch(py))
} else {
Ok(res)
}
}
}bitter-ability-32190
05/23/2024, 11:07 AMcurved-television-6568
05/23/2024, 11:07 AMbitter-ability-32190
05/23/2024, 11:08 AMobject, you should call suoer(), but idk how much that matters herecurved-television-6568
05/23/2024, 11:08 AMcurved-television-6568
05/23/2024, 11:09 AMbitter-ability-32190
05/23/2024, 11:09 AMcurved-television-6568
05/23/2024, 11:09 AMbitter-ability-32190
05/23/2024, 11:10 AMcurved-television-6568
05/23/2024, 11:10 AMcurved-television-6568
05/23/2024, 11:10 AMcurved-television-6568
05/23/2024, 11:12 AMField base class..)bitter-ability-32190
05/23/2024, 11:15 AM__bases___curved-television-6568
05/23/2024, 11:39 AM__bases__ from __getattribute__ I don't think... ðĪcurved-television-6568
05/23/2024, 11:40 AMbitter-ability-32190
05/23/2024, 2:08 PMbitter-ability-32190
05/23/2024, 2:08 PMbitter-ability-32190
05/23/2024, 2:09 PMNote This method may still be bypassed when looking up special methods as the result of implicit invocation via language syntax or built-in functions. See Special method lookup.
bitter-ability-32190
05/23/2024, 2:10 PMcurved-television-6568
05/23/2024, 3:06 PM