Django pre-1.6 is missing __getitem__ and __contains__ implementations.
Python 3 doesn’t have reduce as a builtin.