ferno/greenery — pull request #5 by pjkundert (2013-03-25 20:56:42+00:00)
Title: Python 2 Compatibility

I've added Python 2 compatibility, with minimal impact to the existing code. All unit tests pass in Python 2.7 and Python 3.3. The two main issues were the use of the 'nonlocal' keyword in a closure (it was quite easily removed without losing too much beauty), and the lack of explicit != operators (the __eq__ magic method wasn't being automatically used to implement !=).

o Specify file encoding is utf-8
o Consistenly use tab indentation
o Added != (__ne__) support in terms of == (__eq__) to all classes
o Simplify charclass.escape to not use Python3-only nonlocal keyword
o Add union and concatenation to the main.py demo