Currently Vyper allows range expressions of the form range(x, x + n) where n is a constant. A weird case happens when x is impure:
def foo() -> int128:
self.glob += 1
for i in range(self.foo(), self.foo() + 1):
Even though the range expression contains two calls to self.foo() it is only executed once, which feels very unintuitive at best. In general, it would be nice to have some documentation for loops/range expressions (especially if this is the intended behavior).
The text was updated successfully, but these errors were encountered: