def __lt__(self, other):
        '''Less Than operator. Just compares labels'''
        if not isinstance(other,Node):
            raise TypeError("'<' not supported between instances of '%s' and '%s'"%(type(self).__name__,type(other).__name__))
        elif self.label is None and other.label is not None:
            return True
        elif other.label is None:
            return False
        try:
            return float(self.label) < float(other.label)
        except:
            return str(self.label) < str(other.label)
def __lt__ ( self , other ) : if not isinstance ( other , Node ) : raise TypeError ( "'<' not supported between instances of '%s' and '%s'" % ( type ( self ) . __name__ , type ( other ) . __name__ ) ) elif self . label is None and other . label is not None : return True elif other . label is None : return False try : return float ( self . label ) < float ( other . label ) except : return str ( self . label ) < str ( other . label )
Less Than operator. Just compares labels