@@ -1277,7 +1277,7 @@ unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
12771277typedef struct {
12781278 PyObject_HEAD
12791279 PyObject * str ;
1280- int pos ;
1280+ Py_ssize_t pos ;
12811281} GraphemeClusterIterator ;
12821282
12831283void GCI_Del (PyObject * x )
@@ -1322,36 +1322,17 @@ PyObject* GCI_iternext(PyObject *self)
13221322
13231323static PyTypeObject GraphemeClusterIteratorType = {
13241324 PyVarObject_HEAD_INIT (NULL , 0 )
1325- "unicodedata.GraphemeClusterIterator" , /*tp_name*/
1326- sizeof (GraphemeClusterIterator ), /*tp_basicsize*/
1327- 0 , /*tp_itemsize*/
1328- (destructor )GCI_Del , /*tp_dealloc*/
1329- 0 , /*tp_print*/
1330- 0 , /*tp_getattr*/
1331- 0 , /*tp_setattr*/
1332- 0 , /*tp_compare*/
1333- 0 , /*tp_repr*/
1334- 0 , /*tp_as_number*/
1335- 0 , /*tp_as_sequence*/
1336- 0 , /*tp_as_mapping*/
1337- 0 , /*tp_hash */
1338- 0 , /*tp_call*/
1339- 0 , /*tp_str*/
1340- 0 , /*tp_getattro*/
1341- 0 , /*tp_setattro*/
1342- 0 , /*tp_as_buffer*/
1343- Py_TPFLAGS_DEFAULT ,
1344- "Internal grapheme cluster iterator object." , /* tp_doc */
1345- 0 , /* tp_traverse */
1346- 0 , /* tp_clear */
1347- 0 , /* tp_richcompare */
1348- 0 , /* tp_weaklistoffset */
1349- GCI_iter , /* tp_iter: __iter__() method */
1350- GCI_iternext /* tp_iternext: next() method */
1325+ .tp_name = "unicodedata.GraphemeClusterIterator" ,
1326+ .tp_basicsize = sizeof (GraphemeClusterIterator ),
1327+ .tp_dealloc = (destructor )GCI_Del ,
1328+ .tp_flags = Py_TPFLAGS_DEFAULT ,
1329+ .tp_doc = "Internal grapheme cluster iterator object." ,
1330+ .tp_iter = GCI_iter ,
1331+ .tp_iternext = GCI_iternext
13511332};
13521333
13531334/*[clinic input]
1354- unicodedata.UCD.break_graphemes
1335+ unicodedata.UCD.iter_graphemes
13551336
13561337 self: self
13571338 unistr: unicode
@@ -1363,8 +1344,8 @@ It uses extended grapheme cluster rules from TR29.
13631344[clinic start generated code]*/
13641345
13651346static PyObject *
1366- unicodedata_UCD_break_graphemes_impl (PyObject * self , PyObject * unistr )
1367- /*[clinic end generated code: output=3da536db1b0e5b12 input=d054bb6f190f6dc8 ]*/
1347+ unicodedata_UCD_iter_graphemes_impl (PyObject * self , PyObject * unistr )
1348+ /*[clinic end generated code: output=92374c1d94db4165 input=59c4794a7f2e6742 ]*/
13681349{
13691350 GraphemeClusterIterator * gci = PyObject_New (GraphemeClusterIterator ,
13701351 & GraphemeClusterIteratorType );
@@ -1394,7 +1375,7 @@ static PyMethodDef unicodedata_functions[] = {
13941375 UNICODEDATA_UCD_NAME_METHODDEF
13951376 UNICODEDATA_UCD_LOOKUP_METHODDEF
13961377 UNICODEDATA_UCD_NORMALIZE_METHODDEF
1397- UNICODEDATA_UCD_BREAK_GRAPHEMES_METHODDEF
1378+ UNICODEDATA_UCD_ITER_GRAPHEMES_METHODDEF
13981379 {NULL , NULL } /* sentinel */
13991380};
14001381
0 commit comments