If both are not None and data is not same return false
if ( temp1 != None and temp2 != None ) : NEW_LINE INDENT if ( temp1 . data != temp2 . data ) : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT