def itervalues(dictionary):
    """
  Function to use the generator-based value iterator over built-in
  dictionaries in both Python 2 and 3.
  """
    try:
        return getattr(dictionary, 'itervalues')()
    except AttributeError:
        return iter(getattr(dictionary, 'values')())
