pub fn new(_py: Python, s: &str) -> Py<PyString> {
        let ptr = s.as_ptr() as *const c_char;
        let len = s.len() as ffi::Py_ssize_t;
        unsafe {
            Py::from_owned_ptr_or_panic(ffi::PyUnicode_FromStringAndSize(ptr, len))
        }
    }
/// Creates a new Python string object.
///
/// Panics if out of memory.
Creates a new Python string object.
Panics if out of memory.
Creates a new Python string object . Panics if out of memory .
pub fn new(_py: Python, s: &str) -> Py<PyString> {
        let ptr = s.as_ptr() as *const c_char;
        let len = s.len() as ffi::Py_ssize_t;
        unsafe {
            Py::from_owned_ptr_or_panic(ffi::PyUnicode_FromStringAndSize(ptr, len))
        }
    }
pub fn new ( _py : Python , s : & str ) -> Py < PyString > { let ptr = s . as_ptr ( ) as * const c_char ; let len = s . len ( ) as ffi :: Py_ssize_t ; unsafe { Py :: from_owned_ptr_or_panic ( ffi :: PyUnicode_FromStringAndSize ( ptr , len ) ) } }
Creates a new Python string object.
Creates a new Python string object .
_py
Python
s
&str
_py
Python
s
&str