MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / create_instance_raw

Method create_instance_raw

src/objects/oldstyle.rs:68–75  ·  view source on GitHub ↗

Create a new instance of a specific class without calling its constructor. The dict parameter will be used as the object’s __dict__.

(&self, py: Python, dict: &PyDict)

Source from the content-addressed store, hash-verified

66 /// Create a new instance of a specific class without calling its constructor.
67 /// The dict parameter will be used as the object’s __dict__.
68 pub fn create_instance_raw(&self, py: Python, dict: &PyDict) -> PyResult<PyInstance> {
69 unsafe {
70 err::result_cast_from_owned_ptr(
71 py,
72 ffi::PyInstance_NewRaw(self.as_ptr(), dict.as_object().as_ptr()),
73 )
74 }
75 }
76}

Callers

nothing calls this directly

Calls 3

as_ptrMethod · 0.45
as_objectMethod · 0.45

Tested by

no test coverage detected