March 2019
Beginner
490 pages
12h 40m
English
In the same way as with the network objects, you can check whether the address is private, reserved, or multicast.
In this example, the loopback interface is defined with the ::1 IP address. As you can see, the is_loopback property returns true:
>>> loopback = ipaddress.IPv6Interface('::1') >>> loopback.is_private True >>> loopback.is_reserved True >>> loopback.is_multicast False >>> loopback.is_loopback True
The IP address classes have many more interesting properties. You can perform some arithmetic and logical operations on those objects. For example, we can check if an IP address is part of a network.
In this example, we check whether an IP is a part of a specific network. Here, a network net has been defined by ...
Read now
Unlock full access