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

Method value

src/objects/num.rs:84–86  ·  view source on GitHub ↗

Gets the value of this integer. Warning: `PyInt::value()` is only supported for Python 2.7 `int` objects, but not for `long` objects. In almost all cases, you can avoid the distinction between these types by simply calling `obj.extract:: (py)`.

(&self, _py: Python)

Source from the content-addressed store, hash-verified

82 /// In almost all cases, you can avoid the distinction between these types
83 /// by simply calling `obj.extract::<i32>(py)`.
84 pub fn value(&self, _py: Python) -> c_long {
85 unsafe { ffi::PyInt_AS_LONG(self.0.as_ptr()) }
86 }
87}
88
89impl PyFloat {

Callers

nothing calls this directly

Calls 2

PyInt_AS_LONGFunction · 0.85
as_ptrMethod · 0.45

Tested by

no test coverage detected