<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __updateRequest(self, rect, dy):
 """Repaint line number area if necessary """

        if dy:
            self.scroll(0, dy)
        elif self._countCache[0] != self._qpart.blockCount() or \
             self._countCache[1] != self._qpart.textCursor().block().lineCount():

            # if block height not added to rect, last line number sometimes is not drawn
            blockHeight = self._qpart.blockBoundingRect(self._qpart.firstVisibleBlock()).height()

            self.update(0, rect.y(), self.width(), rect.height() + blockHeight)
            self._countCache = (self._qpart.blockCount(), self._qpart.textCursor().block().lineCount())

        if rect.contains(self._qpart.viewport().rect()):
            self._qpart.updateViewportMargins()