| 129 | |
| 130 | #[inline] |
| 131 | pub fn call_method<T>(&self, obj: &PyObject, method_name: &str, args: T) -> PyResult |
| 132 | where |
| 133 | T: IntoFuncArgs, |
| 134 | { |
| 135 | flame_guard!(format!("call_method({:?})", method_name)); |
| 136 | |
| 137 | let dynamic_name; |
| 138 | let name = match self.ctx.interned_str(method_name) { |
| 139 | Some(name) => name.as_pystr(&self.ctx), |
| 140 | None => { |
| 141 | dynamic_name = self.ctx.new_str(method_name); |
| 142 | &dynamic_name |
| 143 | } |
| 144 | }; |
| 145 | PyMethod::get(obj.to_owned(), name, self)?.invoke(args, self) |
| 146 | } |
| 147 | |
| 148 | pub fn dir(&self, obj: Option<PyObjectRef>) -> PyResult<PyList> { |
| 149 | let seq = match obj { |