all
PY-W0075all
633 return tuple(x.as_const(eval_ctx) for x in self.items)
634
635 def can_assign(self) -> bool:
636 for item in self.items: 637 if not item.can_assign():
638 return False
639 return True
It is recommended to use all
for this loop, as it will make your code smaller and more readable.
def all_even(items):
for item in items:
if item % 2 != 0:
return False
return True
def all_even(items):
return all(item % 2 == 0 for item in items)