Fix folding for python 3, QTextCursor are not hasheable