Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

According to documentation it is not so much a db included as an interface to one:

> dbm is a generic interface to variants of the DBM database — dbm.gnu or dbm.ndbm. If none of these modules is installed, the slow-but-simple implementation in module dbm.dumb will be used. There is a third party interface to the Oracle Berkeley DB

https://docs.python.org/3/library/dbm.html



When it includes a fallback implementation so that you can rely on it working, I think it’s fair to call it “included”.


The main issue here is that, given it relies on whatever implementation of DBM you have installed, its performance will vary considerably from OS to OS.

I don't know how fast or slow the "dumb" implementation is, but I can bet it is way slower than gdbm. I can see someone using this module, considering it "fast enough" on GNU/Linux and then finding out that it's painfully slow on Windows and shipping binaries of another implementation is a massive PITA.


Right but the on-disk formats between versions won't be compatible...


Each of which has it's own set of limitations and watch-outs. I would not use the python dbm interface for anything serious. Ndbm, for example, has a per item value limit that varies between ~1-4k.


Yeah, dbm is a posix database utility that's been around forever. There's a few implementations available and there are bindings for most languages.

https://en.wikipedia.org/wiki/DBM_(computing)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: