rust-cpython
                                
                                
                                
                                    rust-cpython copied to clipboard
                            
                            
                            
                        ToPyObject example incorrect for PyString
ToPyObject indicates that:
You can always calls
val.to_py_object(py).into_py_object()in order to obtainPyObject(the second into_py_object() call via thePythonObjecttrait corresponds to the upcast fromPyListtoPyObject).
But this doesn't seem to be the case for PyString, for which the ToPyObject impl targets itself, making the into_py_object call a noop.
You should be able to use into_object() to convert a PyString to a PyObject.  (into_py_object() just converts to the downcasted type, which is already PyString).
(I'll update the docs later)