[Python-Dev] conceptual clarity
Antoine Pitrou
solipsis at pitrou.net
Thu Sep 17 13:58:09 CEST 2009
Le Thu, 17 Sep 2009 14:30:28 +1200, Greg Ewing a écrit :
>
> 3) an Address with an attached Network
>
> An Address could be constructed in three ways:
>
> Address(ip_number)
>
> Address(ip_number, network = <Network instance>)
>
> Address(ip_number, mask = <mask>)
> # constructs and attaches a suitably-masked Network instance
>
> We could also have some_network[n] return an Address referring back to
> the network object it was obtained from.
It seems you are uselessly conflating two perfectly distinct concepts:
Address and Network. You also haven't addresses the issue of comparing
together (and hashing) two addresses with the same IP but pointing to a
different network. No answer to this issue seems satisfactory and
obviously right.
As it is, -1 from me. Either we only keep two concepts (Address and
Network), or if we introduce a third one (AddressWithMask, whatever) for
added practicality; but we shouldn't blur the line between the two former
canonical concepts under the pretext that a platypus-like Address might
be helpful in some particular situations.
Regards
Antoine.
More information about the Python-Dev
mailing list