@@ -1031,13 +1031,16 @@ element_iterfind(ElementObject *self, PyObject *args, PyObject *kwds)
1031
1031
}
1032
1032
1033
1033
static PyObject *
1034
- element_get (ElementObject * self , PyObject * args )
1034
+ element_get (ElementObject * self , PyObject * args , PyObject * kwds )
1035
1035
{
1036
1036
PyObject * value ;
1037
+ static char * kwlist [] = {"key" , "default" , 0 };
1037
1038
1038
1039
PyObject * key ;
1039
1040
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 ))
1041
1044
return NULL ;
1042
1045
1043
1046
if (!self -> extra || self -> extra -> attrib == Py_None )
@@ -1085,10 +1088,12 @@ create_elementiter(ElementObject *self, PyObject *tag, int gettext);
1085
1088
1086
1089
1087
1090
static PyObject *
1088
- element_iter (ElementObject * self , PyObject * args )
1091
+ element_iter (ElementObject * self , PyObject * args , PyObject * kwds )
1089
1092
{
1090
1093
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 ))
1092
1097
return NULL ;
1093
1098
1094
1099
return create_elementiter (self , tag , 0 );
@@ -1555,7 +1560,7 @@ static PyMethodDef element_methods[] = {
1555
1560
1556
1561
{"clear" , (PyCFunction ) element_clearmethod , METH_VARARGS },
1557
1562
1558
- {"get" , (PyCFunction ) element_get , METH_VARARGS },
1563
+ {"get" , (PyCFunction ) element_get , METH_VARARGS | METH_KEYWORDS },
1559
1564
{"set" , (PyCFunction ) element_set , METH_VARARGS },
1560
1565
1561
1566
{"find" , (PyCFunction ) element_find , METH_VARARGS | METH_KEYWORDS },
@@ -1567,11 +1572,11 @@ static PyMethodDef element_methods[] = {
1567
1572
{"insert" , (PyCFunction ) element_insert , METH_VARARGS },
1568
1573
{"remove" , (PyCFunction ) element_remove , METH_VARARGS },
1569
1574
1570
- {"iter" , (PyCFunction ) element_iter , METH_VARARGS },
1575
+ {"iter" , (PyCFunction ) element_iter , METH_VARARGS | METH_KEYWORDS },
1571
1576
{"itertext" , (PyCFunction ) element_itertext , METH_VARARGS },
1572
1577
{"iterfind" , (PyCFunction ) element_iterfind , METH_VARARGS | METH_KEYWORDS },
1573
1578
1574
- {"getiterator" , (PyCFunction ) element_iter , METH_VARARGS },
1579
+ {"getiterator" , (PyCFunction ) element_iter , METH_VARARGS | METH_KEYWORDS },
1575
1580
{"getchildren" , (PyCFunction ) element_getchildren , METH_VARARGS },
1576
1581
1577
1582
{"items" , (PyCFunction ) element_items , METH_VARARGS },
@@ -3461,7 +3466,7 @@ static PyTypeObject XMLParser_Type = {
3461
3466
/* python module interface */
3462
3467
3463
3468
static PyMethodDef _functions [] = {
3464
- {"SubElement" , (PyCFunction ) subelement , METH_VARARGS | METH_KEYWORDS },
3469
+ {"SubElement" , (PyCFunction ) subelement , METH_VARARGS | METH_KEYWORDS },
3465
3470
{NULL , NULL }
3466
3471
};
3467
3472
0 commit comments