'Pushes a new element.'

def push(self, x):

    assert (self._data is not None)
    if (len(self._data) < self._n):
        heapq.heappush(self._data, x)
    else:
        heapq.heappushpop(self._data, x)
