For example, for a solution [0, 1, 2, 3, 0, 4, 5, 6, 7, 0] the corresponding endnode_to_route values would be [X, 0, None, 0, X, 1, None, None, 1, X]. Currenlty, the depot is assigned to the route 0 in endnode_to_route, but with a cursory glance, it would probably also be assigned to None (to indicate this, I've used X in the example), which would make the use of None in the code more consistent.
For example, for a solution [0, 1, 2, 3, 0, 4, 5, 6, 7, 0] the corresponding endnode_to_route values would be [X, 0, None, 0, X, 1, None, None, 1, X]. Currenlty, the depot is assigned to the route 0 in endnode_to_route, but with a cursory glance, it would probably also be assigned to None (to indicate this, I've used X in the example), which would make the use of None in the code more consistent.