Issue 47 in netaddr: IPNetwork cannot be evaluated as a boolean when it has a large size

0 views
Skip to first unread message

codesite...@google.com

unread,
Sep 14, 2009, 2:24:41 PM9/14/09
to net...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 47 by garron.moore: IPNetwork cannot be evaluated as a boolean
when it has a large size
http://code.google.com/p/netaddr/issues/detail?id=47

What steps will reproduce the problem?
1.
if IPNetwork('2002::/64'):
pass

What is the expected output? What do you see instead?
The expected output is nothing but I get a traceback. Since IPNetwork does
not implement __nonzero__(), the if statement results in the __len__()
method getting called, which for a network with this many IP addresses,
raises IndexError.

What version of the product are you using? On what operating system?
0.7.2

Please provide any additional information below.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Sep 14, 2009, 2:58:53 PM9/14/09
to net...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 47 by drkjam: IPNetwork cannot be evaluated as a

Thanks. I'll take a look.

codesite...@google.com

unread,
Sep 14, 2009, 6:22:28 PM9/14/09
to net...@googlegroups.com

Comment #2 on issue 47 by drkjam: IPNetwork cannot be evaluated as a

Fixed in branches/rel-0.7.x, revision 337.

codesite...@google.com

unread,
Sep 14, 2009, 6:26:31 PM9/14/09
to net...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 47 by drkjam: IPNetwork cannot be evaluated as a

(No comment was entered for this change.)

codesite...@google.com

unread,
Sep 14, 2009, 7:01:00 PM9/14/09
to net...@googlegroups.com

Comment #4 on issue 47 by garron.moore: IPNetwork cannot be evaluated as a

Wow, quick turnaround. Thanks!

Reply all
Reply to author
Forward
0 new messages