'sort header instances as specified by RFC 2616
Re-define sorting so that general headers are first, followed
by request/response headers, and then entity headers.  The
list.sort() methods use the less-than operator for this purpose.'

def __lt__(self, other):

    if isinstance(other, HTTPHeader):
        if (self.sort_order != other.sort_order):
            return (self.sort_order < other.sort_order)
        return (self.name < other.name)
    return False
