bittercode/pyrrhic-ree — pull request #3 by thebearbear (2013-02-07 11:32:14+00:00)
Title: Updated checkChange to work with re better

I have updated the check change implementation to take advantage of the
fact that the flags
provided by the re module are powers of 2. this means that we can write
a very concise function
that just XOR the flags with the toggled flag thus turning them on if
off and off if on.

Lambdas enabled me to give each toggle a unique way to call check change
easily, each toggle will now pass the change function a flag.

Why this is awesome. If we want to implement more flags we can easily do
that by calling the new function with the flag. Since there is no longer
any logic at all any power of 2 will work. No logic means no maintence
in any future versions. It is much shorter so therefore there is less to
keep track of.

Most important - functionality remains unchanged.