(
&self,
name: &'static str,
class: &'static Py<PyType>,
f: F,
)
| 87 | } |
| 88 | |
| 89 | pub fn new_method<F, FKind>( |
| 90 | &self, |
| 91 | name: &'static str, |
| 92 | class: &'static Py<PyType>, |
| 93 | f: F, |
| 94 | ) -> PyRef<PyMethodDescriptor> |
| 95 | where |
| 96 | F: IntoPyNativeFn<FKind>, |
| 97 | { |
| 98 | let def = self |
| 99 | .ctx |
| 100 | .new_method_def(name, f, PyMethodFlags::METHOD, None); |
| 101 | def.build_method(class, self) |
| 102 | } |
| 103 | |
| 104 | /// Instantiate an exception with arguments. |
| 105 | /// This function should only be used with builtin exception types; if a user-defined exception |
no test coverage detected