@@ -1031,13 +1031,16 @@ element_iterfind(ElementObject *self, PyObject *args, PyObject *kwds)
10311031}
10321032
10331033static PyObject *
1034- element_get (ElementObject * self , PyObject * args )
1034+ element_get (ElementObject * self , PyObject * args , PyObject * kwds )
10351035{
10361036 PyObject * value ;
1037+ static char * kwlist [] = {"key" , "default" , 0 };
10371038
10381039 PyObject * key ;
10391040 PyObject * default_value = Py_None ;
1040- if (!PyArg_ParseTuple (args , "O|O:get" , & key , & default_value ))
1041+
1042+ if (!PyArg_ParseTupleAndKeywords (args , kwds , "O|O:get" , kwlist , & key ,
1043+ & default_value ))
10411044 return NULL ;
10421045
10431046 if (!self -> extra || self -> extra -> attrib == Py_None )
@@ -1085,10 +1088,12 @@ create_elementiter(ElementObject *self, PyObject *tag, int gettext);
10851088
10861089
10871090static PyObject *
1088- element_iter (ElementObject * self , PyObject * args )
1091+ element_iter (ElementObject * self , PyObject * args , PyObject * kwds )
10891092{
10901093 PyObject * tag = Py_None ;
1091- if (!PyArg_ParseTuple (args , "|O:iter" , & tag ))
1094+ static char * kwlist [] = {"tag" , 0 };
1095+
1096+ if (!PyArg_ParseTupleAndKeywords (args , kwds , "|O:iter" , kwlist , & tag ))
10921097 return NULL ;
10931098
10941099 return create_elementiter (self , tag , 0 );
@@ -1555,7 +1560,7 @@ static PyMethodDef element_methods[] = {
15551560
15561561 {"clear" , (PyCFunction ) element_clearmethod , METH_VARARGS },
15571562
1558- {"get" , (PyCFunction ) element_get , METH_VARARGS },
1563+ {"get" , (PyCFunction ) element_get , METH_VARARGS | METH_KEYWORDS },
15591564 {"set" , (PyCFunction ) element_set , METH_VARARGS },
15601565
15611566 {"find" , (PyCFunction ) element_find , METH_VARARGS | METH_KEYWORDS },
@@ -1567,11 +1572,11 @@ static PyMethodDef element_methods[] = {
15671572 {"insert" , (PyCFunction ) element_insert , METH_VARARGS },
15681573 {"remove" , (PyCFunction ) element_remove , METH_VARARGS },
15691574
1570- {"iter" , (PyCFunction ) element_iter , METH_VARARGS },
1575+ {"iter" , (PyCFunction ) element_iter , METH_VARARGS | METH_KEYWORDS },
15711576 {"itertext" , (PyCFunction ) element_itertext , METH_VARARGS },
15721577 {"iterfind" , (PyCFunction ) element_iterfind , METH_VARARGS | METH_KEYWORDS },
15731578
1574- {"getiterator" , (PyCFunction ) element_iter , METH_VARARGS },
1579+ {"getiterator" , (PyCFunction ) element_iter , METH_VARARGS | METH_KEYWORDS },
15751580 {"getchildren" , (PyCFunction ) element_getchildren , METH_VARARGS },
15761581
15771582 {"items" , (PyCFunction ) element_items , METH_VARARGS },
@@ -3461,7 +3466,7 @@ static PyTypeObject XMLParser_Type = {
34613466/* python module interface */
34623467
34633468static PyMethodDef _functions [] = {
3464- {"SubElement" , (PyCFunction ) subelement , METH_VARARGS | METH_KEYWORDS },
3469+ {"SubElement" , (PyCFunction ) subelement , METH_VARARGS | METH_KEYWORDS },
34653470 {NULL , NULL }
34663471};
34673472
0 commit comments