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
While it appears you can mix/match a list of IPNetwork and IPAddress objects into IPSet for construction you cannot pass a list that contains an IPRange object. This leads to an asymmetry when handling large datasets that contain multiple of each type.
Attempts to add any range objects if they are part of a set fail. Even if all objects in list are range type.
>>> my_set = IPSet([IPRange('10.0.0.0', "10.0.1.31"), IPRange('192.168.1.0', '192.168.1.5')])
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\netaddr\ip\sets.py", line 121, in __init__
for cidr in cidr_merge(mergeable):
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\netaddr\ip\__init__.py", line 1549, in cidr_merge
cidr = IPNetwork(ip)
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\netaddr\ip\__init__.py", line 923, in __init__
implicit_prefix, flags)
File "C:\Program Files (x86)\Python 3.5\lib\site-packages\netaddr\ip\__init__.py", line 818, in parse_ip_network
raise TypeError('unexpected type %s for addr arg' % type(addr))
TypeError: unexpected type <class 'netaddr.ip.IPRange'> for addr arg
This same error type is reported when adding a mixed set of object types if one of those types include an IPRange or when passing a list of a single IPRange object.
The text was updated successfully, but these errors were encountered:
While it appears you can mix/match a list of IPNetwork and IPAddress objects into IPSet for construction you cannot pass a list that contains an IPRange object. This leads to an asymmetry when handling large datasets that contain multiple of each type.
Working Examples
Attempts to add any range objects if they are part of a set fail. Even if all objects in list are range type.
This same error type is reported when adding a mixed set of object types if one of those types include an IPRange or when passing a list of a single IPRange object.
The text was updated successfully, but these errors were encountered: