Returns number of occurrences of item in DEPQ. Performance: O(1)

def count(self, item):
        """Returns number of occurrences of item in DEPQ. Performance: O(1)"""
        try:
            return self.items.get(item, 0)
        except TypeError:
            return self.items.get(repr(item), 0)