diff --git a/spacy/attrs.pyx b/spacy/attrs.pyx index 363dd094d..50b868bc4 100644 --- a/spacy/attrs.pyx +++ b/spacy/attrs.pyx @@ -91,6 +91,9 @@ IDS = { "MORPH": MORPH, "IDX": IDX, } +# Make these ints in Python, so that we don't get this unexpected 'flag' type +# This will match the behaviour before Cython 3 +IDS = {name: int(value) for name, value in IDS.items()} # ATTR IDs, in order of the symbol diff --git a/spacy/parts_of_speech.pyx b/spacy/parts_of_speech.pyx index 1e643c099..9e539c16c 100644 --- a/spacy/parts_of_speech.pyx +++ b/spacy/parts_of_speech.pyx @@ -23,7 +23,9 @@ IDS = { "SPACE": SPACE } - +# Make these ints in Python, so that we don't get this unexpected 'flag' type +# This will match the behaviour before Cython 3 +IDS = {name: int(value) for name, value in IDS.items()} NAMES = {value: key for key, value in IDS.items()} # As of Cython 3.1, the global Python namespace no longer has the enum