Closed GoogleCodeExporter closed 9 years ago
I think len() on a network object returning the length of the string
representation doesn't pass the principal of least astonishment. That is, *I*
would expect (and indeed, initially coded it this way), that len() on a network
object would return the number of addresses contained in the network. That was
ditched when I found out that __len__ always returns (or returned in python <
3.x, I'm not sure what it does these days) a 32 bit integer, which is obviously
insufficient for ipv6 networks.
anyway, the tl;dr, as you mentioned, is to do len(str(network)).
Original comment by pmo...@google.com
on 10 Sep 2014 at 2:42
ok, sounds reasonable.
Original comment by morr...@google.com
on 10 Sep 2014 at 2:45
Original issue reported on code.google.com by
morr...@google.com
on 9 Sep 2014 at 8:01