def _dict_iteritems(dictionary):
    """Get an iterator or view on the items of the specified dictionary.

    This method is Python 2 and Python 3 compatible.
    """
    try:
        return dictionary.iteritems()
    except AttributeError:
        return dictionary.items()