I would say addresses and networks should not be sortable as they
represent two different objects. It would be like trying to sort
watches and gears together.
If sorting of them together in the same list is a must have I would
expect a address to always compare less then a network so the list had
all the networks sorted first then the addresses. For the example from
issue #28 I would expect the following results.
192.0.2.0/28
192.0.2.0/29
192.0.2.0/30
192.0.2.0/31
192.0.2.2/31
192.0.2.4/30
192.0.2.4/31
192.0.2.6/31
192.0.2.8/29
192.0.2.8/30
192.0.2.8/31
192.0.2.10/31
192.0.2.12/30
192.0.2.12/31
192.0.2.14/31
192.0.2.0
192.0.2.1
192.0.2.2
192.0.2.3
192.0.2.4
192.0.2.5
192.0.2.6
192.0.2.7
192.0.2.8
192.0.2.9
192.0.2.10
192.0.2.11
192.0.2.12
192.0.2.13
192.0.2.14
192.0.2.15
Unless anyone has any strenuous objections, I'll add a mixed sort function the user can pass to sorted() if they want to sort networks and addresses and I'll make the default be that they're not sortable.