You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally, the class IPv4Network "hosts" function is modified to "iter" when mask is /31.
This works well when the network is a string, however when the network is an integer, it does not work.
In the init function of the class, there are two conditions upon which the hosts function is not adjusted:
if isinstance(address, (_compat_int_types, bytes)):
if isinstance(address, tuple):
Modification of hosts, only applies when both conditions are failing:
if self._prefixlen == (self._max_prefixlen - 1):
self.hosts = self.iter
The problem has been discovered when using exclude_address, the result is an iterator of IPv4Network objects created using integers. hosts function does not work when one of the remaining IPv4Network is a /31.
The text was updated successfully, but these errors were encountered:
Normally, the class IPv4Network "hosts" function is modified to "iter" when mask is /31.
This works well when the network is a string, however when the network is an integer, it does not work.
In the init function of the class, there are two conditions upon which the hosts function is not adjusted:
if isinstance(address, (_compat_int_types, bytes)):
if isinstance(address, tuple):
Modification of hosts, only applies when both conditions are failing:
if self._prefixlen == (self._max_prefixlen - 1):
self.hosts = self.iter
The problem has been discovered when using exclude_address, the result is an iterator of IPv4Network objects created using integers. hosts function does not work when one of the remaining IPv4Network is a /31.
The text was updated successfully, but these errors were encountered: