Cross language exception (#10023)

This commit is contained in:
fyrestone
2020-08-26 10:46:05 +08:00
committed by GitHub
parent 1e99b814f0
commit 08adbb371f
30 changed files with 441 additions and 137 deletions
+3
View File
@@ -222,6 +222,9 @@ cdef class Language:
cdef from_native(const CLanguage& lang):
return Language(<int32_t>lang)
def value(self):
return <int32_t>self.lang
def __eq__(self, other):
return (isinstance(other, Language) and
(<int32_t>self.lang) == (<int32_t>(<Language>other).lang))