assert is a statement in python, not a function. Useing parens with it
leads to madness, because assert takes two arguments in the form `assert
expression: bool, message: str`. With parens though it's tempting to
write `assert(expression, message)`, which results in an assert that is
*always* true, because a non-empty tuple (which is what is written) is
*never* false.
Reviewd-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18917>
if d in struct_dict:
self.deps[d] = struct_dict[d]
else:
- assert(d in enum_dict)
+ assert d in enum_dict
def add_xml(self, items):
for d in self.deps.values():
f.write('{0}<{1}'.format(spaces, node.tag))
attribs = genxml_desc[node.tag]
for a in node.attrib:
- assert(a in attribs)
+ assert a in attribs
for a in attribs:
if a in node.attrib:
f.write(' {0}="{1}"'.format(a, node.attrib[a]))