<br><div class="gmail_quote">On Tue, Nov 16, 2010 at 4:17 AM, Antonio Cuni <span dir="ltr">&lt;<a href="mailto:anto.cuni@gmail.com">anto.cuni@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Dan,<br>
first: thanks for your help :-)<div class="im"><br>
<br>
On 16/11/10 03:17, Dan Stromberg wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Yes, the dbm module in pypy is basically like the bsddb module in cpython.<br>
<br>
cpython includes modules for bsddb, gdbm, and more.<br>
<br>
I tend to prefer gdbm over bsddb, because I&#39;ve seen bsddb databases get<br>
corrupt too many times - EG, when a filesystem overflows.  bsddb might be a<br>
little faster though; I&#39;ve never compared their performance.<br>
</blockquote>
<br></div>
So, if I understand correctly you are saying that we should rename our dbm.py to bsdb.py, and write a new dbm.py which can use either bsdb or gdbm?<br>
Sounds fine, do you feel like implementing it? :-)<br>
<br>
Moreover, I also agree with amaury that your code is very similar to the one in the current dbm.py, so we should maybe try to refactor things to share common parts between the twos.<br>
<br>
ciao,<br>
Anto<br>
</blockquote></div><br>Wow, CPython&#39;s Berkeley DB interface is actually quite a bit more comprehensive and complex than I&#39;d realized.  This isn&#39;t just a matter of renaming dbm.py to bsddb.py and refactoring a bit.  It&#39;s more of a time commitment to something I don&#39;t use than I&#39;d thought.<br>
<br>Althought pypy&#39;s current dbm.py implements something similar to cpython&#39;s Berkeley DB interface, it isn&#39;t all that similar.  It uses a subset of the same on-disk representations, but the API appears to be pretty different.  This is based on playing around in the unit tests and bsddb module a bit.<br>
<br>I actually suggest:<br>1) svn rename&#39;ing dbm.py into some unused directory for history&#39;s sake; 
it implements the ndbm _interface_ (a little oddly called &quot;dbm&quot; in 
cpython - but I believe true &quot;dbm&quot; is &quot;one database per program&quot;) well, 
but it&#39;s not really all that similar to bsddb.<br>2) Adding the gdbm.py module I wrote, more or less verbatim.<br><br>I got into the project of merging these two things thinking that bsddb was mostly just like the gdbm module, but bsddb is actually quite a bit more involved, and is something I&#39;ve pretty much stopped using due bad experiences with bsddb database corruption from both cpython and C.<br>
<br>Given #1 and #2 above, anydbm should continue working, due to the presence of gdbm and dumbdbm.<br><br>I guess I think that if someone has a need for bsddb (and it&#39;s assorted interfaces), they probably should work on that.<br>
<br>Sound reasonable?<br><br>