diff Python/sysmodule.c @ 47194:59ab2cf002fa legacy-trunk

Patch #2488: Add sys.maxsize.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 20 May 2008 08:11:19 +0000
parents b8e7a161611c
children 4fe192d48960
line wrap: on
line diff
--- a/Python/sysmodule.c	Tue May 20 08:10:03 2008 +0000
+++ b/Python/sysmodule.c	Tue May 20 08:11:19 2008 +0000
@@ -992,6 +992,7 @@
 Static objects:\n\
 \n\
 maxint -- the largest supported integer (the smallest is -maxint-1)\n\
+maxsize -- the largest supported length of containers.\n\
 maxunicode -- the largest supported character\n\
 builtin_module_names -- tuple of module names built into this interpreter\n\
 version -- the version of this interpreter as a string\n\
@@ -1345,6 +1346,8 @@
 			    PyString_FromString(Py_GetPrefix()));
 	SET_SYS_FROM_STRING("exec_prefix",
 		   	    PyString_FromString(Py_GetExecPrefix()));
+	SET_SYS_FROM_STRING("maxsize",
+			    PyInt_FromSsize_t(PY_SSIZE_T_MAX));
 	SET_SYS_FROM_STRING("maxint",
 			    PyInt_FromLong(PyInt_GetMax()));
 	SET_SYS_FROM_STRING("py3kwarning",