cpython: 060cfd049d14 (original) (raw)

--- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -220,7 +220,7 @@ PyTypeObject _PyManagedBuffer_Type = { PyDoc_STRVAR(memory_doc, -"memoryview(object)\n[](#l1.7) +"memoryview($module, object)\n--\n[](#l1.8) \n[](#l1.9) Create a new memoryview object which references the given object."); @@ -2897,6 +2897,7 @@ PyDoc_STRVAR(memory_f_contiguous_doc, PyDoc_STRVAR(memory_contiguous_doc, "A bool indicating whether the memory is contiguous."); + static PyGetSetDef memory_getsetlist[] = { {"obj", (getter)memory_obj_get, NULL, memory_obj_doc}, {"nbytes", (getter)memory_nbytes_get, NULL, memory_nbytes_doc}, @@ -2914,19 +2915,19 @@ static PyGetSetDef memory_getsetlist[] = }; PyDoc_STRVAR(memory_release_doc, -"M.release() -> None\n[](#l1.24) +"release($self, /)\n--\n[](#l1.25) \n[](#l1.26) Release the underlying buffer exposed by the memoryview object."); PyDoc_STRVAR(memory_tobytes_doc, -"M.tobytes() -> bytes\n[](#l1.29) +"tobytes($self, /)\n--\n[](#l1.30) \n[](#l1.31) Return the data in the buffer as a byte string."); PyDoc_STRVAR(memory_tolist_doc, -"M.tolist() -> list\n[](#l1.34) +"tolist($self, /)\n--\n[](#l1.35) \n[](#l1.36) Return the data in the buffer as a list of elements."); PyDoc_STRVAR(memory_cast_doc, -"M.cast(format[, shape]) -> memoryview\n[](#l1.39) +"cast($self, /, format, *, shape)\n--\n[](#l1.40) \n[](#l1.41) Cast a memoryview to a new format or shape.");