summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-07-13 03:56:50 (GMT)
committerGuido van Rossum <guido@python.org>1997-07-13 03:56:50 (GMT)
commit74ba24758e4d4b8f0a0dcd5451daee42fe4dc0c3 (patch)
tree2665d4b87958ef18c8b3c3644ac13403c208d4b7 /Objects/fileobject.c
parent4dddff8ddf2f19039b19121eaba552678cf0d798 (diff)
downloadcpython-74ba24758e4d4b8f0a0dcd5451daee42fe4dc0c3.zip
cpython-74ba24758e4d4b8f0a0dcd5451daee42fe4dc0c3.tar.gz
cpython-74ba24758e4d4b8f0a0dcd5451daee42fe4dc0c3.tar.bz2
Reordered list of methods to hopefully put the most frequently used
ones near the front. Also added a missing "return -1" to PyFile_WriteString.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 9547d5d..d47b1db 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -839,21 +839,21 @@ file_writelines(f, args)
}
static PyMethodDef file_methods[] = {
- {"close", (PyCFunction)file_close, 0},
- {"flush", (PyCFunction)file_flush, 0},
- {"fileno", (PyCFunction)file_fileno, 0},
- {"isatty", (PyCFunction)file_isatty, 0},
- {"read", (PyCFunction)file_read, 1},
{"readline", (PyCFunction)file_readline, 1},
- {"readlines", (PyCFunction)file_readlines, 1},
+ {"read", (PyCFunction)file_read, 1},
+ {"write", (PyCFunction)file_write, 0},
+ {"fileno", (PyCFunction)file_fileno, 0},
{"seek", (PyCFunction)file_seek, 0},
#ifdef HAVE_FTRUNCATE
{"truncate", (PyCFunction)file_truncate, 0},
#endif
{"tell", (PyCFunction)file_tell, 0},
- {"write", (PyCFunction)file_write, 0},
- {"writelines", (PyCFunction)file_writelines, 0},
{"readinto", (PyCFunction)file_readinto, 0},
+ {"readlines", (PyCFunction)file_readlines, 1},
+ {"writelines", (PyCFunction)file_writelines, 0},
+ {"flush", (PyCFunction)file_flush, 0},
+ {"close", (PyCFunction)file_close, 0},
+ {"isatty", (PyCFunction)file_isatty, 0},
{NULL, NULL} /* sentinel */
};
@@ -1027,4 +1027,6 @@ PyFile_WriteString(s, f)
Py_DECREF(v);
return err;
}
+ else
+ return -1;
}