Skip to content

Commit

Permalink
Relocate get_elsize doc-comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
pearu committed Sep 1, 2021
1 parent 8c5f004 commit 2693f48
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions numpy/f2py/src/fortranobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,15 +712,16 @@ static int swap_arrays(PyArrayObject* obj1, PyArrayObject* obj2) {
||(PyArray_ISSTRING(arr) && PyTypeNum_ISSTRING(type_num)) \
)

/*
get_elsize determines array itemsize from a Python object. Returns
elsize if succesful, -1 otherwise.
Supported types of the input are: numpy.ndarray, bytes, str, tuple,
list.
*/
static int
get_elsize(PyObject *obj) {
/*
get_elsize determines array itemsize from a Python object. Returns
elsize if succesful, -1 otherwise.
Supported types of the input are: numpy.ndarray, bytes, str, tuple,
list.
*/

if (PyArray_Check(obj)) {
return PyArray_DESCR((PyArrayObject *)obj)->elsize;
} else if (PyBytes_Check(obj)) {
Expand Down

0 comments on commit 2693f48

Please sign in to comment.