jfinkels/flask-restless — pull request #217 by croach (2013-06-12 23:48:59+00:00)
Title: Updated `__repr__` methods for several classes to work with Python 2.6 and above

In a Python 2.6 repl an exception is thrown when viewing instances of
the Filter, SearchParameters, and OrderyBy classes. This is because
the call to `str.format` in the `__repr__` method of each omits the
indexes for the arguments, which is a feature added in Python 2.7.

From the Python docs [7.1.3. Format String Syntax][1], "Changed in
version 2.7: The positional argument specifiers can be omitted, so '{}
{}' is equivalent to '{0} {1}'."

Also, the current code only works with Python 2.7+, this change gets
the code to work with Python 2.6+, but if you want the code to work
properly with Python 2.5+, you'll need to remove all calls to `str.format`
completely since that method [was added in Python 2.6][2].

[1]: http://docs.python.org/2/library/string.html#format-string-syntax
[2]: http://docs.python.org/2/library/stdtypes.html#str.format