Hi,
Right now the database is closed as soon as the LevelDB object is garbage collected. In CPython this seems to happen as soon as the reference count drops to zero. Iterators maintain a reference to the LevelDB object, which is removed as soon as they are garbage collected.
I did consider adding such a method, but decided not to do it for now. You´d need to check for each operation whether the database had been previously closed, and make that check thread-safe, and without a race condition.
If you´re interested please write a feature request, and I´ll see if I can make this happen.
Regards, Árni Már