def itervalues(obj, **kwargs):
    """Use this only if compatibility with Python versions before 2.7 is
    required. Otherwise, prefer viewvalues().
    """
    func = getattr(obj, 'itervalues', None)
    if not func:
        func = obj.values
    return func(**kwargs)
