while()
-
@frederik @justvanrossum Am I crazy, or did one of the recent updates of DB introduce a while() function that can replace save() and restore()? Perhaps I'm misremembering the name; in any case I can't find it here on the forum. Any help?
-
This is
savedState()
http://www.drawbot.com/content/canvas/state.html#drawBot.savedStatewith savedState(): # do something
This is more readable and clearer then wrapping code inside a
save
/restore
statement.
-
@frederik Ah! Thanks, I had totally misremembered that.
-
see also
http://pythonfordesigners.com/how-to-keep-doing-things-until-you-need-to/
http://robofont.com/documentation/building-tools/python/collections-loops/#while-loops