I wanted a piece of code to write alternatively to the left and right sides of a deque. I remembered a stackoverflow question about toggling with an excellent answer from Raymond Hettinger. So I now have this.

right = not right

Isn't that just beautiful?

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to