''' Documentation BUG: documentation mentions hostmask attribute of IPv4Network class returns a `string`, but in actual it is returning the object of class IPv4Address URL to official doc: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.hostmask code showing the actual result: ''' import ipaddress as ip ip1 = ip.IPv4Network('192.168.1.0') rv = ip1.hostmask print(type(rv)) # prints: # which is not a string! # assert isinstance(rv, str) # should be True as per Documentation assert isinstance(rv, ip.IPv4Address)