Hello,<br><br>I found pybloom module from <a href="http://www.imperialviolet.org/pybloom.html">http://www.imperialviolet.org/pybloom.html</a> and tried to use it for my crawler:)<br>I want to use it to store the URLs which have been crawled. But when I insert a URL string I always get a warning and wrong result...
<br><br>My testing code is quite simple:<br><span style="color: rgb(51, 102, 255);">from pybloom import CountedBloom</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">cb = CountedBloom(800000, 4)
</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">cb.insert("AAA")</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">print cb.__contains__("BBB")
</span><br><br>Warning:<br><span style="color: rgb(255, 0, 0);">E:\EclipseWorkspace\demo\src\pybloom.py:74: DeprecationWarning: 'I' format requires 0 <= number <= 4294967295</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">  b = [ord(x) for x in struct.pack ('I', val)]</span><br><br>I will get warning when running the code above.<br>The output is "1" which means "BBB" is in the set. But actually it is not...
<br>When I use integer for testing it seems right.<br><br>I am not familiar with arithmetic and I don't know if I wrote something wrong.<br>Can anyone help me? Thanks!<br><br><br clear="all"><br>-- <br>Zhang Xiao<br><br>
Junior engineer, Web development<br><br>Ethos Tech.<br><a href="http://www.ethos.com.cn">http://www.ethos.com.cn</a>