@@ -840,10 +840,10 @@ PyWrapper_New(PyObject *d, PyObject *self)
840840}
841841
842842
843- /* A built-in 'getset ' type */
843+ /* A built-in 'property ' type */
844844
845845/*
846- class getset (object):
846+ class property (object):
847847
848848 def __init__(self, get=None, set=None):
849849 self.__get = get
@@ -867,12 +867,12 @@ typedef struct {
867867 PyObject * get ;
868868 PyObject * set ;
869869 PyObject * del ;
870- } getsetobject ;
870+ } propertyobject ;
871871
872872static void
873- getset_dealloc (PyObject * self )
873+ property_dealloc (PyObject * self )
874874{
875- getsetobject * gs = (getsetobject * )self ;
875+ propertyobject * gs = (propertyobject * )self ;
876876
877877 Py_XDECREF (gs -> get );
878878 Py_XDECREF (gs -> set );
@@ -881,9 +881,9 @@ getset_dealloc(PyObject *self)
881881}
882882
883883static PyObject *
884- getset_descr_get (PyObject * self , PyObject * obj , PyObject * type )
884+ property_descr_get (PyObject * self , PyObject * obj , PyObject * type )
885885{
886- getsetobject * gs = (getsetobject * )self ;
886+ propertyobject * gs = (propertyobject * )self ;
887887
888888 if (gs -> get == NULL ) {
889889 PyErr_SetString (PyExc_AttributeError , "unreadable attribute" );
@@ -897,9 +897,9 @@ getset_descr_get(PyObject *self, PyObject *obj, PyObject *type)
897897}
898898
899899static int
900- getset_descr_set (PyObject * self , PyObject * obj , PyObject * value )
900+ property_descr_set (PyObject * self , PyObject * obj , PyObject * value )
901901{
902- getsetobject * gs = (getsetobject * )self ;
902+ propertyobject * gs = (propertyobject * )self ;
903903 PyObject * func , * res ;
904904
905905 if (value == NULL )
@@ -924,12 +924,12 @@ getset_descr_set(PyObject *self, PyObject *obj, PyObject *value)
924924}
925925
926926static int
927- getset_init (PyObject * self , PyObject * args , PyObject * kwds )
927+ property_init (PyObject * self , PyObject * args , PyObject * kwds )
928928{
929929 PyObject * get = NULL , * set = NULL , * del = NULL ;
930- getsetobject * gs = (getsetobject * )self ;
930+ propertyobject * gs = (propertyobject * )self ;
931931
932- if (!PyArg_ParseTuple (args , "|OOO:getset " , & get , & set , & del ))
932+ if (!PyArg_ParseTuple (args , "|OOO:property " , & get , & set , & del ))
933933 return -1 ;
934934 if (get == Py_None )
935935 get = NULL ;
@@ -944,23 +944,23 @@ getset_init(PyObject *self, PyObject *args, PyObject *kwds)
944944 return 0 ;
945945}
946946
947- static char getset_doc [] =
948- "getset ([getfunc[, setfunc[, delfunc]]]) -> getset attribute\n"
947+ static char property_doc [] =
948+ "property ([getfunc[, setfunc[, delfunc]]]) -> property attribute\n"
949949"Typical use to define a managed attribute x of C instances:\n"
950950"class C(object):\n"
951951" def getx(self): return self.__x\n"
952952" def setx(self, value): self.__x = value\n"
953953" def delx(self): del self.__x\n"
954- " x = getset (getx, setx, delx)" ;
954+ " x = property (getx, setx, delx)" ;
955955
956- PyTypeObject PyGetSet_Type = {
956+ PyTypeObject PyProperty_Type = {
957957 PyObject_HEAD_INIT (& PyType_Type )
958958 0 , /* ob_size */
959- "getset " , /* tp_name */
960- sizeof (getsetobject ), /* tp_basicsize */
959+ "property " , /* tp_name */
960+ sizeof (propertyobject ), /* tp_basicsize */
961961 0 , /* tp_itemsize */
962962 /* methods */
963- getset_dealloc , /* tp_dealloc */
963+ property_dealloc , /* tp_dealloc */
964964 0 , /* tp_print */
965965 0 , /* tp_getattr */
966966 0 , /* tp_setattr */
@@ -976,7 +976,7 @@ PyTypeObject PyGetSet_Type = {
976976 0 , /* tp_setattro */
977977 0 , /* tp_as_buffer */
978978 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
979- getset_doc , /* tp_doc */
979+ property_doc , /* tp_doc */
980980 0 , /* tp_traverse */
981981 0 , /* tp_clear */
982982 0 , /* tp_richcompare */
@@ -988,10 +988,10 @@ PyTypeObject PyGetSet_Type = {
988988 0 , /* tp_getset */
989989 0 , /* tp_base */
990990 0 , /* tp_dict */
991- getset_descr_get , /* tp_descr_get */
992- getset_descr_set , /* tp_descr_set */
991+ property_descr_get , /* tp_descr_get */
992+ property_descr_set , /* tp_descr_set */
993993 0 , /* tp_dictoffset */
994- getset_init , /* tp_init */
994+ property_init , /* tp_init */
995995 PyType_GenericAlloc , /* tp_alloc */
996996 PyType_GenericNew , /* tp_new */
997997 _PyObject_Del , /* tp_free */
0 commit comments