[Python-checkins] r63763 - python/branches/okkoto-sizeof/Python/sysmodule.c
robert.schuppenies
python-checkins at python.org
Wed May 28 18:20:07 CEST 2008
Author: robert.schuppenies
Date: Wed May 28 18:20:06 2008
New Revision: 63763
Log:
added comments
Modified:
python/branches/okkoto-sizeof/Python/sysmodule.c
Modified: python/branches/okkoto-sizeof/Python/sysmodule.c
==============================================================================
--- python/branches/okkoto-sizeof/Python/sysmodule.c (original)
+++ python/branches/okkoto-sizeof/Python/sysmodule.c Wed May 28 18:20:06 2008
@@ -642,13 +642,15 @@
static PyObject *
sys_getsizeof(PyObject *self, PyObject *args)
{
- /* work-around to deal with objects which inherit from type */
+ /* work-around to deal with objects which inherit from type, .. */
if (args->ob_type == &PyType_Type) {
return PyObject_CallMethod((PyObject *)(args->ob_type), "__sizeof__", NULL);
}
+ /* .. old-style classes, */
else if (args->ob_type == &PyClass_Type) {
return PyInt_FromSsize_t(PyClass_Type.tp_basicsize);
}
+ /* .. and instances of old-style classes */
else if (args->ob_type == &PyInstance_Type) {
return PyInt_FromSsize_t(PyInstance_Type.tp_basicsize);
}
More information about the Python-checkins
mailing list