@@ -24,18 +24,16 @@ Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
2424 self = (Noddy * )type -> tp_alloc (type , 0 );
2525 if (self != NULL ) {
2626 self -> first = PyUnicode_FromString ("" );
27- if (self -> first == NULL )
28- {
27+ if (self -> first == NULL ) {
2928 Py_DECREF (self );
3029 return NULL ;
31- }
32-
30+ }
31+
3332 self -> last = PyUnicode_FromString ("" );
34- if (self -> last == NULL )
35- {
33+ if (self -> last == NULL ) {
3634 Py_DECREF (self );
3735 return NULL ;
38- }
36+ }
3937
4038 self -> number = 0 ;
4139 }
@@ -50,10 +48,10 @@ Noddy_init(Noddy *self, PyObject *args, PyObject *kwds)
5048
5149 static char * kwlist [] = {"first" , "last" , "number" , NULL };
5250
53- if (! PyArg_ParseTupleAndKeywords (args , kwds , "|SSi" , kwlist ,
54- & first , & last ,
51+ if (! PyArg_ParseTupleAndKeywords (args , kwds , "|SSi" , kwlist ,
52+ & first , & last ,
5553 & self -> number ))
56- return -1 ;
54+ return -1 ;
5755
5856 if (first ) {
5957 tmp = self -> first ;
@@ -88,22 +86,22 @@ Noddy_getfirst(Noddy *self, void *closure)
8886static int
8987Noddy_setfirst (Noddy * self , PyObject * value , void * closure )
9088{
91- if (value == NULL ) {
92- PyErr_SetString (PyExc_TypeError , "Cannot delete the first attribute" );
93- return -1 ;
94- }
95-
96- if (! PyUnicode_Check (value )) {
97- PyErr_SetString (PyExc_TypeError ,
98- "The first attribute value must be a string" );
99- return -1 ;
100- }
101-
102- Py_DECREF (self -> first );
103- Py_INCREF (value );
104- self -> first = value ;
105-
106- return 0 ;
89+ if (value == NULL ) {
90+ PyErr_SetString (PyExc_TypeError , "Cannot delete the first attribute" );
91+ return -1 ;
92+ }
93+
94+ if (! PyUnicode_Check (value )) {
95+ PyErr_SetString (PyExc_TypeError ,
96+ "The first attribute value must be a string" );
97+ return -1 ;
98+ }
99+
100+ Py_DECREF (self -> first );
101+ Py_INCREF (value );
102+ self -> first = value ;
103+
104+ return 0 ;
107105}
108106
109107static PyObject *
@@ -116,30 +114,30 @@ Noddy_getlast(Noddy *self, void *closure)
116114static int
117115Noddy_setlast (Noddy * self , PyObject * value , void * closure )
118116{
119- if (value == NULL ) {
120- PyErr_SetString (PyExc_TypeError , "Cannot delete the last attribute" );
121- return -1 ;
122- }
123-
124- if (! PyUnicode_Check (value )) {
125- PyErr_SetString (PyExc_TypeError ,
126- "The last attribute value must be a string" );
127- return -1 ;
128- }
129-
130- Py_DECREF (self -> last );
131- Py_INCREF (value );
132- self -> last = value ;
133-
134- return 0 ;
117+ if (value == NULL ) {
118+ PyErr_SetString (PyExc_TypeError , "Cannot delete the last attribute" );
119+ return -1 ;
120+ }
121+
122+ if (! PyUnicode_Check (value )) {
123+ PyErr_SetString (PyExc_TypeError ,
124+ "The last attribute value must be a string" );
125+ return -1 ;
126+ }
127+
128+ Py_DECREF (self -> last );
129+ Py_INCREF (value );
130+ self -> last = value ;
131+
132+ return 0 ;
135133}
136134
137135static PyGetSetDef Noddy_getseters [] = {
138- {"first" ,
136+ {"first" ,
139137 (getter )Noddy_getfirst , (setter )Noddy_setfirst ,
140138 "first name" ,
141139 NULL },
142- {"last" ,
140+ {"last" ,
143141 (getter )Noddy_getlast , (setter )Noddy_setlast ,
144142 "last name" ,
145143 NULL },
@@ -164,7 +162,7 @@ Noddy_name(Noddy* self)
164162
165163 result = PyUnicode_Format (format , args );
166164 Py_DECREF (args );
167-
165+
168166 return result ;
169167}
170168
@@ -198,12 +196,12 @@ static PyTypeObject NoddyType = {
198196 Py_TPFLAGS_DEFAULT |
199197 Py_TPFLAGS_BASETYPE , /* tp_flags */
200198 "Noddy objects" , /* tp_doc */
201- 0 , /* tp_traverse */
202- 0 , /* tp_clear */
203- 0 , /* tp_richcompare */
204- 0 , /* tp_weaklistoffset */
205- 0 , /* tp_iter */
206- 0 , /* tp_iternext */
199+ 0 , /* tp_traverse */
200+ 0 , /* tp_clear */
201+ 0 , /* tp_richcompare */
202+ 0 , /* tp_weaklistoffset */
203+ 0 , /* tp_iter */
204+ 0 , /* tp_iternext */
207205 Noddy_methods , /* tp_methods */
208206 Noddy_members , /* tp_members */
209207 Noddy_getseters , /* tp_getset */
@@ -226,7 +224,7 @@ static PyModuleDef noddy3module = {
226224};
227225
228226PyMODINIT_FUNC
229- PyInit_noddy3 (void )
227+ PyInit_noddy3 (void )
230228{
231229 PyObject * m ;
232230
0 commit comments