patch = self.patch if self.patch is not None else 0
return (self.major << 22) | (self.minor << 12) | patch
- def __cmp__(self, other):
+ def __gt__(self, other):
# If only one of them has a patch version, "ignore" it by making
# other's patch version match self.
if (self.patch is None) != (other.patch is None):
other = copy.copy(other)
other.patch = self.patch
- return self.__int_ver().__cmp__(other.__int_ver())
+ return self.__int_ver() > other.__int_ver()
+
MAX_API_VERSION = VkVersion(MAX_API_VERSION)
patch = self.patch if self.patch is not None else 0
return (self.major << 22) | (self.minor << 12) | patch
- def __cmp__(self, other):
+ def __gt__(self, other):
# If only one of them has a patch version, "ignore" it by making
# other's patch version match self.
if (self.patch is None) != (other.patch is None):
other = copy.copy(other)
other.patch = self.patch
- return self.__int_ver().__cmp__(other.__int_ver())
+ return self.__int_ver() > other.__int_ver()
+
MAX_API_VERSION = VkVersion('0.0.0')
def __str__(self):
return self.c_prototype()
- def __cmp__(self, other):
+ def __lt__(self, other):
# compare slot, alias, and then name
- res = cmp(self.slot, other.slot)
- if not res:
+ if self.slot == other.slot:
if not self.alias:
- res = -1
+ return True
elif not other.alias:
- res = 1
+ return False
- if not res:
- res = cmp(self.name, other.name)
+ return self.name < other.name
+
+ return self.slot < other.slot
- return res
def abi_parse_xml(xml):
"""Parse a GLAPI XML file for ABI entries."""