assert all([x % 2 == 0 for x in sequence])
... can be rewritten as the generator comprehension ...
assert all(x % 2 == 0 for x in sequence)
... instead.
You can use the Vim substitution :%s/all(\[\(.*\)\])/all(\1)/g to change all([...]) to all(...) everywhere in a file.
No comments:
Post a Comment