pydoc > _gdbm

🐍 _gdbm Module

🏷️ NAME

_gdbm - This module provides an interface to the GNU DBM (GDBM) library.

🚀 Quick Reference

Use CaseCommandDescription
Open for readingopen('db', 'r')Open existing database read-only
Open for read/writeopen('db', 'w')Open existing database read-write
Open or createopen('db', 'c')Open existing or create new database
Create new databaseopen('db', 'n')Always create a new empty database
Fast mode (no sync)open('db', 'cf')Open with fast mode (faster writes, crash risk)
Sync modeopen('db', 'cs')Open with synchronized writes
Disable lockingopen('db', 'cu')Open without file locking
Force syncdb.sync()Force unwritten data to disk

📚 MODULE REFERENCE

https://docs.python.org/3.10/library/_gdbm.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

📝 DESCRIPTION

This module is quite similar to the dbm module, but uses GDBM instead to provide some additional functionality. Please note that the file formats created by GDBM and dbm are incompatible.

GDBM objects behave like mappings (dictionaries), except that keys and values are always immutable bytes-like objects or strings. Printing a GDBM object doesn't print the keys and values, and the items() and values() methods are not supported.

🏛️ CLASSES

builtins.OSError(builtins.Exception)error

🐛 class error

Method resolution order:

  1. error
  2. builtins.OSError
  3. builtins.Exception
  4. builtins.BaseException
  5. builtins.object

Data descriptors defined here:

Methods inherited from builtins.OSError:

Static methods inherited from builtins.OSError:

Data descriptors inherited from builtins.OSError:

Methods inherited from builtins.BaseException:

Data descriptors inherited from builtins.BaseException:

🔧 FUNCTIONS

📂 open

open(filename, flags='r', mode=438, /)

Open a dbm database and return a dbm object.

The filename argument is the name of the database file.

The optional flags argument can be:

Some versions of gdbm support additional flags which must be appended to one of the flags described above. The module constant open_flags is a string of valid additional flags.

The optional mode argument is the Unix mode of the file, used only when the database has to be created. It defaults to octal 0o666.

📊 DATA

open_flags = 'rwcnfsu'

📁 FILE

/usr/lib/python3.10/lib-dynload/_gdbm.cpython-310-x86_64-linux-gnu.so

_gdbm
🐍 _gdbm Module 🏷️ NAME 🚀 Quick Reference 📚 MODULE REFERENCE 📝 DESCRIPTION 🏛️ CLASSES
🐛 class error
🔧 FUNCTIONS
📂 open
📊 DATA 📁 FILE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-01 16:58 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^