def sstr(obj):
if sys.version_info[<NUM_LIT:0>] == <NUM_LIT:2>:<EOL><INDENT>return unicode(obj).encode(DEFAULT_ENCODING)  <EOL><DEDENT>else:<EOL><INDENT>return obj<EOL><DEDENT>
Python 2 and 3 utility method that converts an obj to a DEFAULT_ENCODING encoded string in python 2
    and to unicode in python 3.
    Especially useful for implementing __str__ methods in python 2: http://stackoverflow.com/a/1307210/381010