"""
A simple module that helps unify the code between a python2 and python3 library.
"""
import sys

def sorted(lst):
    newlst = list(lst)
    newlst.sort()
    return newlst

def reversed(lst):
    newlst = list(lst)
    return iter(newlst[::-1])

"""
A simple module that helps unify the code between a python2 and python3 library.
"""
import sys

try:
    sorted = sorted
except NameError:
    def sorted(lst):
        newlst = list(lst)
        newlst.sort()
        return newlst

try:
    reversed = reversed
except NameError:
    def reversed(lst):
        newlst = list(lst)
        return iter(newlst[::-1])

Use builtin sorted, reversed if available.
Use builtin sorted, reversed if available.

--HG--
extra : convert_revision : svn%3Ae1d34091-3ce9-0310-8e96-997e60db3bd5/trunk%402444
