MCPcopy Index your code
hub / github.com/RustPython/RustPython / to_proper_method

Method to_proper_method

crates/vm/src/function/method.rs:105–119  ·  view source on GitHub ↗
(
        &'static self,
        class: &'static Py<PyType>,
        ctx: &Context,
    )

Source from the content-addressed store, hash-verified

103 }
104
105 pub fn to_proper_method(
106 &'static self,
107 class: &'static Py<PyType>,
108 ctx: &Context,
109 ) -> PyObjectRef {
110 if self.flags.contains(PyMethodFlags::METHOD) {
111 self.build_method(ctx, class).into()
112 } else if self.flags.contains(PyMethodFlags::CLASS) {
113 self.build_classmethod(ctx, class).into()
114 } else if self.flags.contains(PyMethodFlags::STATIC) {
115 self.build_staticmethod(ctx, class).into()
116 } else {
117 unreachable!()
118 }
119 }
120
121 pub const fn to_function(&'static self) -> PyNativeFunction {
122 PyNativeFunction {

Callers 5

extend_pyclassMethod · 0.80
extend_pyclassMethod · 0.80
extend_classMethod · 0.80
module_execFunction · 0.80
extend_methodsMethod · 0.80

Calls 4

build_methodMethod · 0.80
build_classmethodMethod · 0.80
build_staticmethodMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected