def sum(iterable):# implementation of sum
assert sum([]) == 0
assert sum([1, 2, 3]) == 6
A mechanism to say "always execute assert statements in this module
regardless of optimisation level" could also be useful.
That change *along with* a way to "always execute asserts in this scope" would make asserts more useful.