New issue 56 by n6vale: checking IPAddress in IPNetwork
http://code.google.com/p/netaddr/issues/detail?id=56
What steps will reproduce the problem?
print IPAddress('192.168.1.1') in IPNetwork('192.168.1/24')
What is the expected output? What do you see instead?
Should return True, not False
What version of the product are you using? On what operating system?
netaddr 0.74 Ubuntu Linux 10.04
Please provide any additional information below.
Comment #1 on issue 56 by drkjam: checking IPAddress in IPNetwork
http://code.google.com/p/netaddr/issues/detail?id=56
Yep, that's a bug. Will take a look at this for the next release.
=Additional Detail
The address portion of the IPNetwork address '192.168.1' should resolve
to '192.168.1.0', not 192.168.0.1 as it does presently.
Any idea when this might be fixed. I could really do with this ASAP. Or,
is there a work around I could use with the existing version?
Cheers
Yes, there is a workaround, just use the implicit_prefix argument, like
so :-
>>> IPAddress('192.168.1.1') in IPNetwork('192.168.1/24',
>>> implicit_prefix=True)
True
Or simply :-
>>> IPAddress('192.168.1.1') in IPNetwork('192.168.1/24', True)
True
Apologies for the delay. I've been looking for a spare moment to sit down
and work on a release. Should have the next full release out in the next
24-48 hours after I've conducted some proper testing. Thanks for your
patience.