@@ -2114,19 +2114,20 @@ unicodedata_extended_pictographic_impl(PyObject *module, int chr)
21142114}
21152115
21162116
2117- /* XXX Add doc strings. */
2118-
21192117// List of functions used to define module functions *AND* unicodedata.UCD
21202118// methods. For module functions, self is the module. For UCD methods, self
21212119// is an UCD instance. The UCD_Check() macro is used to check if self is
21222120// an UCD instance.
21232121static PyMethodDef unicodedata_functions [] = {
2122+ // Module only functions.
21242123 UNICODEDATA_GRAPHEME_CLUSTER_BREAK_METHODDEF
21252124 UNICODEDATA_INDIC_CONJUNCT_BREAK_METHODDEF
21262125 UNICODEDATA_EXTENDED_PICTOGRAPHIC_METHODDEF
21272126 UNICODEDATA_ITER_GRAPHEMES_METHODDEF
2128- // Update Py_tp_methods in ucd_type_slots if add more module-only
2129- // functions.
2127+
2128+ // The following definitions are shared between the module
2129+ // and the UCD class.
2130+ #define DB_methods (unicodedata_functions + 4)
21302131
21312132 UNICODEDATA_UCD_DECIMAL_METHODDEF
21322133 UNICODEDATA_UCD_DIGIT_METHODDEF
@@ -2159,7 +2160,7 @@ static PyType_Slot ucd_type_slots[] = {
21592160 {Py_tp_dealloc , ucd_dealloc },
21602161 {Py_tp_traverse , _PyObject_VisitType },
21612162 {Py_tp_getattro , PyObject_GenericGetAttr },
2162- {Py_tp_methods , unicodedata_functions + 4 },
2163+ {Py_tp_methods , DB_methods },
21632164 {Py_tp_members , DB_members },
21642165 {0 , 0 }
21652166};
0 commit comments