diff -r a156f602debc Doc/includes/noddy3.c --- a/Doc/includes/noddy3.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Doc/includes/noddy3.c Wed Apr 29 09:03:49 2009 -0700 @@ -79,14 +79,14 @@ }; static PyObject * -Noddy_getfirst(Noddy *self, void *closure) +Noddy_getfirst(Noddy *self) { Py_INCREF(self->first); return self->first; } static int -Noddy_setfirst(Noddy *self, PyObject *value, void *closure) +Noddy_setfirst(Noddy *self, PyObject *value) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, "Cannot delete the first attribute"); @@ -107,14 +107,14 @@ } static PyObject * -Noddy_getlast(Noddy *self, void *closure) +Noddy_getlast(Noddy *self) { Py_INCREF(self->last); return self->last; } static int -Noddy_setlast(Noddy *self, PyObject *value, void *closure) +Noddy_setlast(Noddy *self, PyObject *value) { if (value == NULL) { PyErr_SetString(PyExc_TypeError, "Cannot delete the last attribute"); diff -r a156f602debc Include/descrobject.h --- a/Include/descrobject.h Tue Apr 28 12:42:20 2009 -0700 +++ b/Include/descrobject.h Wed Apr 29 09:03:49 2009 -0700 @@ -5,15 +5,14 @@ extern "C" { #endif -typedef PyObject *(*getter)(PyObject *, void *); -typedef int (*setter)(PyObject *, PyObject *, void *); +typedef PyObject *(*getter)(PyObject *); +typedef int (*setter)(PyObject *, PyObject *); typedef struct PyGetSetDef { char *name; getter get; setter set; char *doc; - void *closure; } PyGetSetDef; typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, diff -r a156f602debc Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_ctypes/_ctypes.c Wed Apr 29 09:03:49 2009 -0700 @@ -1119,7 +1119,7 @@ static PyGetSetDef CharArray_getsets[] = { { "raw", (getter)CharArray_get_raw, (setter)CharArray_set_raw, - "value", NULL }, + "value" }, { "value", (getter)CharArray_get_value, (setter)CharArray_set_value, "string value"}, { NULL, NULL } @@ -2991,12 +2991,12 @@ static PyGetSetDef PyCFuncPtr_getsets[] = { { "errcheck", (getter)PyCFuncPtr_get_errcheck, (setter)PyCFuncPtr_set_errcheck, - "a function to check for errors", NULL }, + "a function to check for errors" }, { "restype", (getter)PyCFuncPtr_get_restype, (setter)PyCFuncPtr_set_restype, - "specify the result type", NULL }, + "specify the result type" }, { "argtypes", (getter)PyCFuncPtr_get_argtypes, (setter)PyCFuncPtr_set_argtypes, - "specify the argument types", NULL }, + "specify the argument types" }, { NULL, NULL } }; @@ -4531,7 +4531,7 @@ static PyGetSetDef Simple_getsets[] = { { "value", (getter)Simple_get_value, (setter)Simple_set_value, - "current value", NULL }, + "current value" }, { NULL, NULL } }; @@ -4724,7 +4724,7 @@ } static PyObject * -Pointer_get_contents(CDataObject *self, void *closure) +Pointer_get_contents(CDataObject *self) { StgDictObject *stgdict; @@ -4742,7 +4742,7 @@ } static int -Pointer_set_contents(CDataObject *self, PyObject *value, void *closure) +Pointer_set_contents(CDataObject *self, PyObject *value) { StgDictObject *stgdict; CDataObject *dst; @@ -4786,7 +4786,7 @@ static PyGetSetDef Pointer_getsets[] = { { "contents", (getter)Pointer_get_contents, (setter)Pointer_set_contents, - "the object this pointer points to (read-write)", NULL }, + "the object this pointer points to (read-write)" }, { NULL, NULL } }; @@ -4799,7 +4799,7 @@ return -1; if (value == NULL) return 0; - return Pointer_set_contents(self, value, NULL); + return Pointer_set_contents(self, value); } static PyObject * diff -r a156f602debc Modules/_ctypes/cfield.c --- a/Modules/_ctypes/cfield.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_ctypes/cfield.c Wed Apr 29 09:03:49 2009 -0700 @@ -221,13 +221,13 @@ } static PyObject * -PyCField_get_offset(PyObject *self, void *data) +PyCField_get_offset(PyObject *self) { return PyLong_FromSsize_t(((CFieldObject *)self)->offset); } static PyObject * -PyCField_get_size(PyObject *self, void *data) +PyCField_get_size(PyObject *self) { return PyLong_FromSsize_t(((CFieldObject *)self)->size); } diff -r a156f602debc Modules/_hashopenssl.c --- a/Modules/_hashopenssl.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_hashopenssl.c Wed Apr 29 09:03:49 2009 -0700 @@ -254,7 +254,7 @@ }; static PyObject * -EVP_get_block_size(EVPobject *self, void *closure) +EVP_get_block_size(EVPobject *self) { long block_size; ENTER_HASHLIB(self); @@ -264,7 +264,7 @@ } static PyObject * -EVP_get_digest_size(EVPobject *self, void *closure) +EVP_get_digest_size(EVPobject *self) { long size; ENTER_HASHLIB(self); diff -r a156f602debc Modules/_io/bufferedio.c --- a/Modules/_io/bufferedio.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_io/bufferedio.c Wed Apr 29 09:03:49 2009 -0700 @@ -387,7 +387,7 @@ } static PyObject * -BufferedIOMixin_closed_get(BufferedObject *self, void *context) +BufferedIOMixin_closed_get(BufferedObject *self) { CHECK_INITIALIZED(self) return PyObject_GetAttr(self->raw, _PyIO_str_closed); @@ -454,14 +454,14 @@ } static PyObject * -BufferedIOMixin_name_get(BufferedObject *self, void *context) +BufferedIOMixin_name_get(BufferedObject *self) { CHECK_INITIALIZED(self) return PyObject_GetAttrString(self->raw, "name"); } static PyObject * -BufferedIOMixin_mode_get(BufferedObject *self, void *context) +BufferedIOMixin_mode_get(BufferedObject *self) { CHECK_INITIALIZED(self) return PyObject_GetAttrString(self->raw, "mode"); @@ -1996,7 +1996,7 @@ } static PyObject * -BufferedRWPair_closed_get(BufferedRWPairObject *self, void *context) +BufferedRWPair_closed_get(BufferedRWPairObject *self) { return PyObject_GetAttr((PyObject *) self->writer, _PyIO_str_closed); } diff -r a156f602debc Modules/_io/fileio.c --- a/Modules/_io/fileio.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_io/fileio.c Wed Apr 29 09:03:49 2009 -0700 @@ -965,19 +965,19 @@ /* 'closed' and 'mode' are attributes for backwards compatibility reasons. */ static PyObject * -get_closed(PyFileIOObject *self, void *closure) +get_closed(PyFileIOObject *self) { return PyBool_FromLong((long)(self->fd < 0)); } static PyObject * -get_closefd(PyFileIOObject *self, void *closure) +get_closefd(PyFileIOObject *self) { return PyBool_FromLong((long)(self->closefd)); } static PyObject * -get_mode(PyFileIOObject *self, void *closure) +get_mode(PyFileIOObject *self) { return PyUnicode_FromString(mode_string(self)); } diff -r a156f602debc Modules/_io/iobase.c --- a/Modules/_io/iobase.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_io/iobase.c Wed Apr 29 09:03:49 2009 -0700 @@ -150,7 +150,7 @@ } static PyObject * -IOBase_closed_get(PyObject *self, void *context) +IOBase_closed_get(PyObject *self) { return PyBool_FromLong(IS_CLOSED(self)); } diff -r a156f602debc Modules/_io/stringio.c --- a/Modules/_io/stringio.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_io/stringio.c Wed Apr 29 09:03:49 2009 -0700 @@ -646,7 +646,7 @@ } static PyObject * -stringio_buffer(StringIOObject *self, void *context) +stringio_buffer(StringIOObject *self) { PyErr_SetString(IO_STATE->unsupported_operation, "buffer attribute is unsupported on type StringIO"); @@ -654,14 +654,14 @@ } static PyObject * -stringio_closed(StringIOObject *self, void *context) +stringio_closed(StringIOObject *self) { CHECK_INITIALIZED(self); return PyBool_FromLong(self->closed); } static PyObject * -stringio_encoding(StringIOObject *self, void *context) +stringio_encoding(StringIOObject *self) { CHECK_INITIALIZED(self); CHECK_CLOSED(self); @@ -669,7 +669,7 @@ } static PyObject * -stringio_errors(StringIOObject *self, void *context) +stringio_errors(StringIOObject *self) { CHECK_INITIALIZED(self); CHECK_CLOSED(self); @@ -677,7 +677,7 @@ } static PyObject * -stringio_line_buffering(StringIOObject *self, void *context) +stringio_line_buffering(StringIOObject *self) { CHECK_INITIALIZED(self); CHECK_CLOSED(self); @@ -685,7 +685,7 @@ } static PyObject * -stringio_newlines(StringIOObject *self, void *context) +stringio_newlines(StringIOObject *self) { CHECK_INITIALIZED(self); CHECK_CLOSED(self); diff -r a156f602debc Modules/_io/textio.c --- a/Modules/_io/textio.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_io/textio.c Wed Apr 29 09:03:49 2009 -0700 @@ -72,7 +72,7 @@ ); static PyObject * -TextIOBase_encoding_get(PyObject *self, void *context) +TextIOBase_encoding_get(PyObject *self) { Py_RETURN_NONE; } @@ -86,7 +86,7 @@ ); static PyObject * -TextIOBase_newlines_get(PyObject *self, void *context) +TextIOBase_newlines_get(PyObject *self) { Py_RETURN_NONE; } diff -r a156f602debc Modules/_multiprocessing/connection.h --- a/Modules/_multiprocessing/connection.h Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_multiprocessing/connection.h Wed Apr 29 09:03:49 2009 -0700 @@ -418,19 +418,19 @@ */ static PyObject * -connection_closed(ConnectionObject *self, void *closure) +connection_closed(ConnectionObject *self) { return PyBool_FromLong((long)(self->handle == INVALID_HANDLE_VALUE)); } static PyObject * -connection_readable(ConnectionObject *self, void *closure) +connection_readable(ConnectionObject *self) { return PyBool_FromLong((long)(self->flags & READABLE)); } static PyObject * -connection_writable(ConnectionObject *self, void *closure) +connection_writable(ConnectionObject *self) { return PyBool_FromLong((long)(self->flags & WRITABLE)); } @@ -465,11 +465,11 @@ static PyGetSetDef connection_getset[] = { {"closed", (getter)connection_closed, NULL, - "True if the connection is closed", NULL}, + "True if the connection is closed"}, {"readable", (getter)connection_readable, NULL, - "True if the connection is readable", NULL}, + "True if the connection is readable"}, {"writable", (getter)connection_writable, NULL, - "True if the connection is writable", NULL}, + "True if the connection is writable"}, {NULL} }; diff -r a156f602debc Modules/_sqlite/connection.c --- a/Modules/_sqlite/connection.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_sqlite/connection.c Wed Apr 29 09:03:49 2009 -0700 @@ -868,13 +868,13 @@ return 1; } -static PyObject* pysqlite_connection_get_isolation_level(pysqlite_Connection* self, void* unused) +static PyObject* pysqlite_connection_get_isolation_level(pysqlite_Connection* self) { Py_INCREF(self->isolation_level); return self->isolation_level; } -static PyObject* pysqlite_connection_get_total_changes(pysqlite_Connection* self, void* unused) +static PyObject* pysqlite_connection_get_total_changes(pysqlite_Connection* self) { if (!pysqlite_check_connection(self)) { return NULL; diff -r a156f602debc Modules/_struct.c --- a/Modules/_struct.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_struct.c Wed Apr 29 09:03:49 2009 -0700 @@ -1637,14 +1637,14 @@ } static PyObject * -s_get_format(PyStructObject *self, void *unused) +s_get_format(PyStructObject *self) { Py_INCREF(self->s_format); return self->s_format; } static PyObject * -s_get_size(PyStructObject *self, void *unused) +s_get_size(PyStructObject *self) { return PyLong_FromSsize_t(self->s_size); } @@ -1665,8 +1665,8 @@ #define OFF(x) offsetof(PyStructObject, x) static PyGetSetDef s_getsetlist[] = { - {"format", (getter)s_get_format, (setter)NULL, "struct format string", NULL}, - {"size", (getter)s_get_size, (setter)NULL, "struct size in bytes", NULL}, + {"format", (getter)s_get_format, (setter)NULL, "struct format string"}, + {"size", (getter)s_get_size, (setter)NULL, "struct size in bytes"}, {NULL} /* sentinel */ }; diff -r a156f602debc Modules/_threadmodule.c --- a/Modules/_threadmodule.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_threadmodule.c Wed Apr 29 09:03:49 2009 -0700 @@ -330,7 +330,7 @@ } static PyObject * -local_getdict(localobject *self, void *closure) +local_getdict(localobject *self) { if (self->dict == NULL) { PyErr_SetString(PyExc_AttributeError, "__dict__"); @@ -343,7 +343,7 @@ static PyGetSetDef local_getset[] = { {"__dict__", (getter)local_getdict, (setter)NULL, - "Local-data dictionary", NULL}, + "Local-data dictionary"}, {NULL} /* Sentinel */ }; diff -r a156f602debc Modules/_tkinter.c --- a/Modules/_tkinter.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/_tkinter.c Wed Apr 29 09:03:49 2009 -0700 @@ -791,7 +791,7 @@ "the string representation of this object, either as str or bytes"); static PyObject * -PyTclObject_string(PyTclObject *self, void *ignored) +PyTclObject_string(PyTclObject *self) { char *s; int len; @@ -884,7 +884,7 @@ PyDoc_STRVAR(get_typename__doc__, "name of the Tcl type"); static PyObject* -get_typename(PyTclObject* obj, void* ignored) +get_typename(PyTclObject* obj) { return PyUnicode_FromString(obj->value->typePtr->name); } diff -r a156f602debc Modules/arraymodule.c --- a/Modules/arraymodule.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/arraymodule.c Wed Apr 29 09:03:49 2009 -0700 @@ -1466,14 +1466,14 @@ static PyObject * -array_get_typecode(arrayobject *a, void *closure) +array_get_typecode(arrayobject *a) { char tc = a->ob_descr->typecode; return PyUnicode_FromStringAndSize(&tc, 1); } static PyObject * -array_get_itemsize(arrayobject *a, void *closure) +array_get_itemsize(arrayobject *a) { return PyLong_FromLong((long)a->ob_descr->itemsize); } diff -r a156f602debc Modules/bz2module.c --- a/Modules/bz2module.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/bz2module.c Wed Apr 29 09:03:49 2009 -0700 @@ -1137,7 +1137,7 @@ /* Getters and setters of BZ2File. */ static PyObject * -BZ2File_get_closed(BZ2FileObject *self, void *closure) +BZ2File_get_closed(BZ2FileObject *self) { return PyLong_FromLong(self->mode == MODE_CLOSED); } diff -r a156f602debc Modules/cjkcodecs/multibytecodec.c --- a/Modules/cjkcodecs/multibytecodec.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/cjkcodecs/multibytecodec.c Wed Apr 29 09:03:49 2009 -0700 @@ -137,8 +137,7 @@ } static int -codecctx_errors_set(MultibyteStatefulCodecContext *self, PyObject *value, - void *closure) +codecctx_errors_set(MultibyteStatefulCodecContext *self, PyObject *value) { PyObject *cb; const char *str; diff -r a156f602debc Modules/datetimemodule.c --- a/Modules/datetimemodule.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/datetimemodule.c Wed Apr 29 09:03:49 2009 -0700 @@ -2178,19 +2178,19 @@ /* Accessor properties. */ static PyObject * -date_year(PyDateTime_Date *self, void *unused) +date_year(PyDateTime_Date *self) { return PyLong_FromLong(GET_YEAR(self)); } static PyObject * -date_month(PyDateTime_Date *self, void *unused) +date_month(PyDateTime_Date *self) { return PyLong_FromLong(GET_MONTH(self)); } static PyObject * -date_day(PyDateTime_Date *self, void *unused) +date_day(PyDateTime_Date *self) { return PyLong_FromLong(GET_DAY(self)); } @@ -3004,32 +3004,32 @@ */ static PyObject * -time_hour(PyDateTime_Time *self, void *unused) +time_hour(PyDateTime_Time *self) { return PyLong_FromLong(TIME_GET_HOUR(self)); } static PyObject * -time_minute(PyDateTime_Time *self, void *unused) +time_minute(PyDateTime_Time *self) { return PyLong_FromLong(TIME_GET_MINUTE(self)); } /* The name time_second conflicted with some platform header file. */ static PyObject * -py_time_second(PyDateTime_Time *self, void *unused) +py_time_second(PyDateTime_Time *self) { return PyLong_FromLong(TIME_GET_SECOND(self)); } static PyObject * -time_microsecond(PyDateTime_Time *self, void *unused) +time_microsecond(PyDateTime_Time *self) { return PyLong_FromLong(TIME_GET_MICROSECOND(self)); } static PyObject * -time_tzinfo(PyDateTime_Time *self, void *unused) +time_tzinfo(PyDateTime_Time *self) { PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None; Py_INCREF(result); @@ -3520,31 +3520,31 @@ */ static PyObject * -datetime_hour(PyDateTime_DateTime *self, void *unused) +datetime_hour(PyDateTime_DateTime *self) { return PyLong_FromLong(DATE_GET_HOUR(self)); } static PyObject * -datetime_minute(PyDateTime_DateTime *self, void *unused) +datetime_minute(PyDateTime_DateTime *self) { return PyLong_FromLong(DATE_GET_MINUTE(self)); } static PyObject * -datetime_second(PyDateTime_DateTime *self, void *unused) +datetime_second(PyDateTime_DateTime *self) { return PyLong_FromLong(DATE_GET_SECOND(self)); } static PyObject * -datetime_microsecond(PyDateTime_DateTime *self, void *unused) +datetime_microsecond(PyDateTime_DateTime *self) { return PyLong_FromLong(DATE_GET_MICROSECOND(self)); } static PyObject * -datetime_tzinfo(PyDateTime_DateTime *self, void *unused) +datetime_tzinfo(PyDateTime_DateTime *self) { PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None; Py_INCREF(result); diff -r a156f602debc Modules/md5module.c --- a/Modules/md5module.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/md5module.c Wed Apr 29 09:03:49 2009 -0700 @@ -436,37 +436,28 @@ }; static PyObject * -MD5_get_block_size(PyObject *self, void *closure) +MD5_get_block_size(PyObject *self) { return PyLong_FromLong(MD5_BLOCKSIZE); } static PyObject * -MD5_get_name(PyObject *self, void *closure) +MD5_get_name(PyObject *self) { return PyUnicode_FromStringAndSize("MD5", 3); } static PyObject * -md5_get_digest_size(PyObject *self, void *closure) +md5_get_digest_size(PyObject *self) { return PyLong_FromLong(MD5_DIGESTSIZE); } static PyGetSetDef MD5_getseters[] = { - {"block_size", - (getter)MD5_get_block_size, NULL, - NULL, - NULL}, - {"name", - (getter)MD5_get_name, NULL, - NULL, - NULL}, - {"digest_size", - (getter)md5_get_digest_size, NULL, - NULL, - NULL}, + {"block_size", (getter)MD5_get_block_size, NULL, NULL}, + {"name", (getter)MD5_get_name, NULL, NULL}, + {"digest_size", (getter)md5_get_digest_size, NULL, NULL}, {NULL} /* Sentinel */ }; diff -r a156f602debc Modules/sha1module.c --- a/Modules/sha1module.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/sha1module.c Wed Apr 29 09:03:49 2009 -0700 @@ -412,37 +412,28 @@ }; static PyObject * -SHA1_get_block_size(PyObject *self, void *closure) +SHA1_get_block_size(PyObject *self) { return PyLong_FromLong(SHA1_BLOCKSIZE); } static PyObject * -SHA1_get_name(PyObject *self, void *closure) +SHA1_get_name(PyObject *self) { return PyUnicode_FromStringAndSize("SHA1", 3); } static PyObject * -sha1_get_digest_size(PyObject *self, void *closure) +sha1_get_digest_size(PyObject *self) { return PyLong_FromLong(SHA1_DIGESTSIZE); } static PyGetSetDef SHA1_getseters[] = { - {"block_size", - (getter)SHA1_get_block_size, NULL, - NULL, - NULL}, - {"name", - (getter)SHA1_get_name, NULL, - NULL, - NULL}, - {"digest_size", - (getter)sha1_get_digest_size, NULL, - NULL, - NULL}, + {"block_size", (getter)SHA1_get_block_size, NULL, NULL}, + {"name", (getter)SHA1_get_name, NULL, NULL}, + {"digest_size", (getter)sha1_get_digest_size, NULL, NULL}, {NULL} /* Sentinel */ }; diff -r a156f602debc Modules/sha256module.c --- a/Modules/sha256module.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/sha256module.c Wed Apr 29 09:03:49 2009 -0700 @@ -505,13 +505,13 @@ }; static PyObject * -SHA256_get_block_size(PyObject *self, void *closure) +SHA256_get_block_size(PyObject *self) { return PyLong_FromLong(SHA_BLOCKSIZE); } static PyObject * -SHA256_get_name(PyObject *self, void *closure) +SHA256_get_name(PyObject *self) { if (((SHAobject *)self)->digestsize == 32) return PyUnicode_FromStringAndSize("SHA256", 6); @@ -520,14 +520,8 @@ } static PyGetSetDef SHA_getseters[] = { - {"block_size", - (getter)SHA256_get_block_size, NULL, - NULL, - NULL}, - {"name", - (getter)SHA256_get_name, NULL, - NULL, - NULL}, + {"block_size", (getter)SHA256_get_block_size, NULL, NULL}, + {"name", (getter)SHA256_get_name, NULL, NULL}, {NULL} /* Sentinel */ }; diff -r a156f602debc Modules/sha512module.c --- a/Modules/sha512module.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Modules/sha512module.c Wed Apr 29 09:03:49 2009 -0700 @@ -571,13 +571,13 @@ }; static PyObject * -SHA512_get_block_size(PyObject *self, void *closure) +SHA512_get_block_size(PyObject *self) { return PyLong_FromLong(SHA_BLOCKSIZE); } static PyObject * -SHA512_get_name(PyObject *self, void *closure) +SHA512_get_name(PyObject *self) { if (((SHAobject *)self)->digestsize == 64) return PyUnicode_FromStringAndSize("SHA512", 6); @@ -586,14 +586,8 @@ } static PyGetSetDef SHA_getseters[] = { - {"block_size", - (getter)SHA512_get_block_size, NULL, - NULL, - NULL}, - {"name", - (getter)SHA512_get_name, NULL, - NULL, - NULL}, + {"block_size", (getter)SHA512_get_block_size, NULL, NULL}, + {"name", (getter)SHA512_get_name, NULL, NULL}, {NULL} /* Sentinel */ }; diff -r a156f602debc Objects/cellobject.c --- a/Objects/cellobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/cellobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -129,7 +129,7 @@ } static PyObject * -cell_get_contents(PyCellObject *op, void *closure) +cell_get_contents(PyCellObject *op) { if (op->ob_ref == NULL) { diff -r a156f602debc Objects/classobject.c --- a/Objects/classobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/classobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -91,7 +91,7 @@ should only be used for the class, not for instances */ static PyObject * -method_get_doc(PyMethodObject *im, void *context) +method_get_doc(PyMethodObject *im) { static PyObject *docstr; if (docstr == NULL) { @@ -438,7 +438,7 @@ }; static PyObject * -instancemethod_get_doc(PyObject *self, void *context) +instancemethod_get_doc(PyObject *self) { static PyObject *docstr; if (docstr == NULL) { diff -r a156f602debc Objects/descrobject.c --- a/Objects/descrobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/descrobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -145,7 +145,7 @@ if (descr_check((PyDescrObject *)descr, obj, &res)) return res; if (descr->d_getset->get != NULL) - return descr->d_getset->get(obj, descr->d_getset->closure); + return descr->d_getset->get(obj); PyErr_Format(PyExc_AttributeError, "attribute '%V' of '%.100s' objects is not readable", descr_name((PyDescrObject *)descr), "?", @@ -199,8 +199,7 @@ if (descr_setcheck((PyDescrObject *)descr, obj, value, &res)) return res; if (descr->d_getset->set != NULL) - return descr->d_getset->set(obj, value, - descr->d_getset->closure); + return descr->d_getset->set(obj, value); PyErr_Format(PyExc_AttributeError, "attribute '%V' of '%.100s' objects is not writable", descr_name((PyDescrObject *)descr), "?", @@ -310,7 +309,7 @@ } static PyObject * -method_get_doc(PyMethodDescrObject *descr, void *closure) +method_get_doc(PyMethodDescrObject *descr) { if (descr->d_method->ml_doc == NULL) { Py_INCREF(Py_None); @@ -331,7 +330,7 @@ }; static PyObject * -member_get_doc(PyMemberDescrObject *descr, void *closure) +member_get_doc(PyMemberDescrObject *descr) { if (descr->d_member->doc == NULL) { Py_INCREF(Py_None); @@ -346,7 +345,7 @@ }; static PyObject * -getset_get_doc(PyGetSetDescrObject *descr, void *closure) +getset_get_doc(PyGetSetDescrObject *descr) { if (descr->d_getset->doc == NULL) { Py_INCREF(Py_None); @@ -361,7 +360,7 @@ }; static PyObject * -wrapperdescr_get_doc(PyWrapperDescrObject *descr, void *closure) +wrapperdescr_get_doc(PyWrapperDescrObject *descr) { if (descr->d_base->doc == NULL) { Py_INCREF(Py_None); diff -r a156f602debc Objects/fileobject.c --- a/Objects/fileobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/fileobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -455,20 +455,20 @@ }; static PyObject * -get_closed(PyStdPrinter_Object *self, void *closure) +get_closed(PyStdPrinter_Object *self) { Py_INCREF(Py_False); return Py_False; } static PyObject * -get_mode(PyStdPrinter_Object *self, void *closure) +get_mode(PyStdPrinter_Object *self) { return PyUnicode_FromString("w"); } static PyObject * -get_encoding(PyStdPrinter_Object *self, void *closure) +get_encoding(PyStdPrinter_Object *self) { Py_RETURN_NONE; } diff -r a156f602debc Objects/floatobject.c --- a/Objects/floatobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/floatobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -1702,7 +1702,7 @@ "This affects how floats are converted to and from binary strings."); static PyObject * -float_getzero(PyObject *v, void *closure) +float_getzero(PyObject *v) { return PyFloat_FromDouble(0.0); } @@ -1762,12 +1762,10 @@ static PyGetSetDef float_getset[] = { {"real", (getter)float_float, (setter)NULL, - "the real part of a complex number", - NULL}, + "the real part of a complex number"}, {"imag", (getter)float_getzero, (setter)NULL, - "the imaginary part of a complex number", - NULL}, + "the imaginary part of a complex number"}, {NULL} /* Sentinel */ }; diff -r a156f602debc Objects/frameobject.c --- a/Objects/frameobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/frameobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -24,7 +24,7 @@ }; static PyObject * -frame_getlocals(PyFrameObject *f, void *closure) +frame_getlocals(PyFrameObject *f) { PyFrame_FastToLocals(f); Py_INCREF(f->f_locals); @@ -32,7 +32,7 @@ } static PyObject * -frame_getlineno(PyFrameObject *f, void *closure) +frame_getlineno(PyFrameObject *f) { int lineno; @@ -321,7 +321,7 @@ } static PyObject * -frame_gettrace(PyFrameObject *f, void *closure) +frame_gettrace(PyFrameObject *f) { PyObject* trace = f->f_trace; @@ -334,7 +334,7 @@ } static int -frame_settrace(PyFrameObject *f, PyObject* v, void *closure) +frame_settrace(PyFrameObject *f, PyObject* v) { /* We rely on f_lineno being accurate when f_trace is set. */ diff -r a156f602debc Objects/longobject.c --- a/Objects/longobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/longobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -3832,8 +3832,13 @@ } static PyObject * -long_getN(PyLongObject *v, void *context) { - return PyLong_FromLong((Py_intptr_t)context); +long_get0(PyLongObject *v) { + return PyLong_FromLong(0); +} + +static PyObject * +long_get1(PyLongObject *v) { + return PyLong_FromLong(1); } static PyObject * @@ -4093,20 +4098,16 @@ static PyGetSetDef long_getset[] = { {"real", (getter)long_long, (setter)NULL, - "the real part of a complex number", - NULL}, + "the real part of a complex number"}, {"imag", - (getter)long_getN, (setter)NULL, - "the imaginary part of a complex number", - (void*)0}, + (getter)long_get0, (setter)NULL, + "the imaginary part of a complex number"}, {"numerator", (getter)long_long, (setter)NULL, - "the numerator of a rational number in lowest terms", - NULL}, + "the numerator of a rational number in lowest terms"}, {"denominator", - (getter)long_getN, (setter)NULL, - "the denominator of a rational number in lowest terms", - (void*)1}, + (getter)long_get1, (setter)NULL, + "the denominator of a rational number in lowest terms"}, {NULL} /* Sentinel */ }; diff -r a156f602debc Objects/methodobject.c --- a/Objects/methodobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/methodobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -135,7 +135,7 @@ } static PyObject * -meth_get__doc__(PyCFunctionObject *m, void *closure) +meth_get__doc__(PyCFunctionObject *m) { const char *doc = m->m_ml->ml_doc; @@ -146,7 +146,7 @@ } static PyObject * -meth_get__name__(PyCFunctionObject *m, void *closure) +meth_get__name__(PyCFunctionObject *m) { return PyUnicode_FromString(m->m_ml->ml_name); } @@ -160,7 +160,7 @@ } static PyObject * -meth_get__self__(PyCFunctionObject *m, void *closure) +meth_get__self__(PyCFunctionObject *m) { PyObject *self; diff -r a156f602debc Objects/typeobject.c --- a/Objects/typeobject.c Tue Apr 28 12:42:20 2009 -0700 +++ b/Objects/typeobject.c Wed Apr 29 09:03:49 2009 -0700 @@ -202,7 +202,7 @@ }; static PyObject * -type_name(PyTypeObject *type, void *context) +type_name(PyTypeObject *type) { const char *s; @@ -223,7 +223,7 @@ } static int -type_set_name(PyTypeObject *type, PyObject *value, void *context) +type_set_name(PyTypeObject *type, PyObject *value) { PyHeapTypeObject* et; char *tp_name; @@ -275,7 +275,7 @@ } static PyObject * -type_module(PyTypeObject *type, void *context) +type_module(PyTypeObject *type) { PyObject *mod; char *s; @@ -299,7 +299,7 @@ } static int -type_set_module(PyTypeObject *type, PyObject *value, void *context) +type_set_module(PyTypeObject *type, PyObject *value) { if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { PyErr_Format(PyExc_TypeError, @@ -318,7 +318,7 @@ } static PyObject * -type_abstractmethods(PyTypeObject *type, void *context) +type_abstractmethods(PyTypeObject *type) { PyObject *mod = PyDict_GetItemString(type->tp_dict, "__abstractmethods__"); @@ -331,7 +331,7 @@ } static int -type_set_abstractmethods(PyTypeObject *type, PyObject *value, void *context) +type_set_abstractmethods(PyTypeObject *type, PyObject *value) { /* __abstractmethods__ should only be set once on a type, in abc.ABCMeta.__new__, so this function doesn't do anything @@ -352,7 +352,7 @@ } static PyObject * -type_get_bases(PyTypeObject *type, void *context) +type_get_bases(PyTypeObject *type) { Py_INCREF(type->tp_bases); return type->tp_bases; @@ -413,7 +413,7 @@ } static int -type_set_bases(PyTypeObject *type, PyObject *value, void *context) +type_set_bases(PyTypeObject *type, PyObject *value) { Py_ssize_t i; int r = 0; @@ -554,7 +554,7 @@ } static PyObject * -type_dict(PyTypeObject *type, void *context) +type_dict(PyTypeObject *type) { if (type->tp_dict == NULL) { Py_INCREF(Py_None); @@ -564,7 +564,7 @@ } static PyObject * -type_get_doc(PyTypeObject *type, void *context) +type_get_doc(PyTypeObject *type) { PyObject *result; if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE) && type->tp_doc != NULL) @@ -599,7 +599,7 @@ static PyObject * -type_get_instancecheck(PyObject *type, void *context) +type_get_instancecheck(PyObject *type) { static PyMethodDef ml = {"__instancecheck__", type___instancecheck__, METH_O }; @@ -620,7 +620,7 @@ } static PyObject * -type_get_subclasscheck(PyObject *type, void *context) +type_get_subclasscheck(PyObject *type) { static PyMethodDef ml = {"__subclasscheck__", type___subclasscheck__, METH_O }; @@ -645,14 +645,14 @@ { PyObject *mod, *name, *rtn; - mod = type_module(type, NULL); + mod = type_module(type); if (mod == NULL) PyErr_Clear(); else if (!PyUnicode_Check(mod)) { Py_DECREF(mod); mod = NULL; } - name = type_name(type, NULL); + name = type_name(type); if (name == NULL) return NULL; @@ -1717,7 +1717,7 @@ } static PyObject * -subtype_dict(PyObject *obj, void *context) +subtype_dict(PyObject *obj) { PyObject **dictptr; PyObject *dict; @@ -1753,7 +1753,7 @@ } static int -subtype_setdict(PyObject *obj, PyObject *value, void *context) +subtype_setdict(PyObject *obj, PyObject *value) { PyObject **dictptr; PyObject *dict; @@ -1795,7 +1795,7 @@ } static PyObject * -subtype_getweakref(PyObject *obj, void *context) +subtype_getweakref(PyObject *obj) { PyObject **weaklistptr; PyObject *result; @@ -2736,7 +2736,7 @@ /* Compute ", ".join(sorted(type.__abstractmethods__)) into joined. */ - abstract_methods = type_abstractmethods(type, NULL); + abstract_methods = type_abstractmethods(type); if (abstract_methods == NULL) goto error; builtins = PyEval_GetBuiltins(); @@ -2787,14 +2787,14 @@ PyObject *mod, *name, *rtn; type = Py_TYPE(self); - mod = type_module(type, NULL); + mod = type_module(type); if (mod == NULL) PyErr_Clear(); else if (!PyUnicode_Check(mod)) { Py_DECREF(mod); mod = NULL; } - name = type_name(type, NULL); + name = type_name(type); if (name == NULL) return NULL; if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins")) @@ -2862,7 +2862,7 @@ } static PyObject * -object_get_class(PyObject *self, void *closure) +object_get_class(PyObject *self) { Py_INCREF(Py_TYPE(self)); return (PyObject *)(Py_TYPE(self)); @@ -2948,7 +2948,7 @@ } static int -object_set_class(PyObject *self, PyObject *value, void *closure) +object_set_class(PyObject *self, PyObject *value) { PyTypeObject *oldto = Py_TYPE(self); PyTypeObject *newto;