[Python-Dev] Fwd: PEP 3144 review. (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Thu Sep 17 16:56:57 CEST 2009
- Previous message: [Python-Dev] Fwd: PEP 3144 review.
- Next message: [Python-Dev] Fwd: PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
DrKJam <drkjam gmail.com> writes:
BTW, has anyone considered use of the term *CIDR to refer to an address + mask object?
This sounds too obscure for a non-specialist.
Obviously we'd still have the issue of what to do with the host bits to the right of the supplied mask (keep or discard). This is not a clear cut choice of one or the other as it is entirely based on context. For configuring routes, you would likely always want to discard these bits (or at least Cisco does when adding routes). For configuring a network interface you would most certainly want to keep them!
When configuring a network interface you are not specifying a network, you are specifying two things:
- a host address to which the interface is bound (all bits significant)
- a network to which the interface is connected (lower bits non-significant)
As someone pointed out, the fact that you are specifying a single string like "10.0.1.7/8" is just a notational convenience.
Therefore, it seems clear to me that Network objects should ignore (and perhaps zero out) the host bits at the right of the netmask. When you configure an interface from the aforementioned notational convenience, you should retrieve two objects, a Network, and an Address.
Regards
Antoine.
- Previous message: [Python-Dev] Fwd: PEP 3144 review.
- Next message: [Python-Dev] Fwd: PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]