Is there a way to create a python object that will be not sortable?

Posted by Graf on Stack Overflow See other posts from Stack Overflow or by Graf
Published on 2010-03-02T21:55:28Z Indexed on 2010/03/27 1:33 UTC
Read the original article Hit count: 254

Filed under:

Is there a possibility to create any python object that will be not sortable? So that will be an exception when trying to sort a list of that objects? I created a very simple class, didn't define any comparison methods, but still instances of this class are comparable and thus sortable. Maybe, my class inherits comparison methods from somewhere. But I don't want this behaviour.

© Stack Overflow or respective owner

Related posts about python