<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cmpFormatRanges(a, b):
 """PyQt does not define proper comparison for QTextLayout.FormatRange Define it to check correctly, if formats has changed. It is important for the performance """

    if a.format == b.format and \
       a.start == b.start and \
       a.length == b.length:
        return 0
    else:
        return cmp(id(a), id(b))