Skip to content

Problems with dbm documentation #50187

Description

@MLModel
mannequin
BPO 5937
Nosy @birkenfeld, @MLModel
Superseder
  • bpo-6045: Add more dict methods to dbm interfaces
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/birkenfeld'
    closed_at = <Date 2009-05-17.08:47:12.638>
    created_at = <Date 2009-05-05.04:19:16.215>
    labels = ['docs']
    title = 'Problems with dbm documentation'
    updated_at = <Date 2009-05-17.08:47:12.636>
    user = 'https://github.com/MLModel'

    bugs.python.org fields:

    activity = <Date 2009-05-17.08:47:12.636>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2009-05-17.08:47:12.638>
    closer = 'georg.brandl'
    components = ['Documentation']
    creation = <Date 2009-05-05.04:19:16.215>
    creator = 'MLModel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 5937
    keywords = []
    message_count = 4.0
    messages = ['87208', '87257', '87270', '87969']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'MLModel']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '6045'
    type = None
    url = 'https://bugs.python.org/issue5937'
    versions = ['Python 3.0', 'Python 3.1']

    Activity

    1. MLModel commented on May 5, 2009

      MLModelmannequin
      MannequinAuthor

      There are some problems with the dbm documentation. In the opening section:

      1. The comment before the iteration example says that .values() works,
        but the method is not defined.
      2. The statement in the paragraph after the documentation of dbm.open()
        says that the opened dbm object "supports most of the same functionality
        as dictionaries". It specifically mentions keys(), but should state that
        values() is not supported.
      3. I disagree with the use of the word "most" there. It does support a
        minimal dictionary-like interface, but it provides only about 1/3 of the
        method that dict does.
      4. The documentation should point out that keys() returns a list not a
        dict_keys object.
      5. The example code shows the use of iteritems() but the documentation
        doesn't mention it. In any case, there is no such method.
      6. In fact, the comment at the beginning of dbm/init.py states that
        the interface is limited to set, get, and del using [] notation, the in
        operator (and though not stated, the not in operator), and k.keys().

      The Unix dbm section does state that values() and items() are not
      supported, but the gdbm section does not (and should).

      I hope this is all accurate. In general, the whole page should be edited
      to be consistent with the actual implementation.

    2. MLModel commented on May 5, 2009

      MLModelmannequin
      MannequinAuthor

      Further confusion:
      dbm.dumb._Database objects DO support items(), DO NOT support
      iteritems(), and DO support iterkeys()

      My previous comments referred to the general dbm documentation and the
      specifics of dbm.gnu. I haven't checked any of this against the Unix
      ndbm implementation.

    3. MLModel commented on May 5, 2009

      MLModelmannequin
      MannequinAuthor

      And, checking the methods of dbm.ndbm, I find get() and setdefault() but
      nothing like iterkeys() or iteritems(), just keys().

      I think it might also be worth pointing out that a particular variation
      of dbm may be chosen to create a database file by calling the
      submodule's open function -- dbm.gdbm.open(), dbm.ndbm.open(), or
      dbm.dumb.open().

    4. birkenfeld commented on May 17, 2009

      @birkenfeld
      Member

      Superseded by bpo-6045.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions