[Python-Dev] PEP 3144 review. (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Tue Sep 15 20:07:23 CEST 2009
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Scott Dial <scott+python-dev scottdial.com> writes:
>>> gateway = net[1] I was then confused, because: >>> print(type(gateway)) <class 'ipaddr.IPv4Address'> Which sorta blew my mind.. I fully expected to receive an IPNetwork back from that operation.
Speaking as a non-network specialist, it actually looks logical to me to be given an address if I iterate over a network (the same way that, if I iterate on a list, I get individual elements, not 1-element sublists).
I don't understand why you think the network mask should be part of an address. An address is just an address, it specifies the location of a host, not the configuration of the network surrounding it. If you look at an IP header, the destination address doesn't specify a netmask.
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] PEP 3144 review.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]