def _cmp(self, other):
self_gen  = traverse_frozen_data(self.payload)<EOL>other_gen = traverse_frozen_data(other.payload)<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>self_node  = repr(next(self_gen))<EOL><DEDENT>except StopIteration:<EOL><INDENT>self_node  = None<EOL><DEDENT>try:<EOL><INDENT>other_node = repr(next(other_gen))<EOL><DEDENT>except StopIteration:<EOL><INDENT>other_node = None<EOL><DEDENT>if self_node is None or other_node is None:<EOL><INDENT>if self_node is not None:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>if other_node is not None:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT>return <NUM_LIT:0><EOL><DEDENT>if self_node != other_node:<EOL><INDENT>return (<EOL>self_node > other_node<EOL>) - (<EOL>self_node < other_node<EOL>)<EOL><DEDENT><DEDENT>
Generic cmp method to support python 2/3