Buffer arguments as PyObject by youknowone · Pull Request #4913 · RustPython/RustPython
// Python/getargs.c
pub fn as_object(&self) -> &PyObject { &self.0.obj } }
impl From<ArgBytesLike> for PyBuffer {
impl ArgStrOrBytesLike { pub fn as_object(&self) -> &PyObject { match self { Self::Buf(b) => b.as_object(), Self::Str(s) => s.as_object(), } } }
impl TryFromObject for ArgStrOrBytesLike { fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> { obj.downcast()