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

Method name

src/objects/typeobject.rs:49–51  ·  view source on GitHub ↗

Gets the name of the PyType.

(&'a self, _py: Python<'a>)

Source from the content-addressed store, hash-verified

47
48 /// Gets the name of the PyType.
49 pub fn name<'a>(&'a self, _py: Python<'a>) -> Cow<'a, str> {
50 unsafe { CStr::from_ptr((*self.as_type_ptr()).tp_name).to_string_lossy() }
51 }
52
53 /// Return true if `self` is a subtype of `b`.
54 #[inline]

Callers

nothing calls this directly

Calls 2

to_string_lossyMethod · 0.80
as_type_ptrMethod · 0.80

Tested by

no test coverage detected