ClientRoutesEndPoint can represent endpoints whose original_port is None, but endpoint identity and ordering need to handle that optional value consistently.
Problem
Client routes use (host_id, original address, original port) to distinguish endpoints that can otherwise refer to the same host/address through different ports. Once original_port participates in endpoint identity, ordering must also tolerate None values.
A direct tuple comparison containing both None and int port values can raise TypeError under Python 3 when metadata code sorts endpoints.
Expected behavior
ClientRoutesEndPoint should:
- include
original_port in equality and hashing,
- provide a stable comparison key when one endpoint has
original_port=None and another has an integer port,
- keep metadata endpoint ordering deterministic.
ClientRoutesEndPointcan represent endpoints whoseoriginal_portisNone, but endpoint identity and ordering need to handle that optional value consistently.Problem
Client routes use
(host_id, original address, original port)to distinguish endpoints that can otherwise refer to the same host/address through different ports. Onceoriginal_portparticipates in endpoint identity, ordering must also tolerateNonevalues.A direct tuple comparison containing both
Noneandintport values can raiseTypeErrorunder Python 3 when metadata code sorts endpoints.Expected behavior
ClientRoutesEndPointshould:original_portin equality and hashing,original_port=Noneand another has an integer port,