[Python-Dev] conceptual clarity (original) (raw)
Eric Smith eric at trueblade.com
Thu Sep 17 14:14:34 CEST 2009
- Previous message: [Python-Dev] conceptual clarity
- Next message: [Python-Dev] conceptual clarity
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Antoine Pitrou wrote:
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(ipnumber) Address(ipnumber, network = ) Address(ipnumber, mask = ) # constructs and attaches a suitably-masked Network instance We could also have somenetwork[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.
I completely agree with this. By keeping the concepts distinct we can catch mis-uses earlier. If needed, convenience functions (or classes, or whatever) could be layered on top. But the underlying concepts need to be clear.
Eric.
- Previous message: [Python-Dev] conceptual clarity
- Next message: [Python-Dev] conceptual clarity
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]