A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-September/082348.html below:

can we make dbm's .keys() return an iterator?

[Python-Dev] Python 3.0: can we make dbm's .keys() return an iterator? [Python-Dev] Python 3.0: can we make dbm's .keys() return an iterator?Gerhard Häring gh at ghaering.de
Thu Sep 11 11:40:59 CEST 2008
As far as I can see, the specification of the dbm interface is the 
module docstring in dbm/__init__.py, which reads:

"""
[...]
It has the following interface (key and data are strings):

         d[key] = data   # store data at key (may override data at
                         # existing key)
         data = d[key]   # retrieve data at key (raise KeyError if no
                         # such key)
         del d[key]      # delete data stored at key (raises KeyError
                         # if no such key)
         flag = key in d # true if the key exists
         list = d.keys() # return a list of all existing keys (slow!)
"""

Now I thought that in Python 3.0, keys(), values() and friends should 
return iterators. Can we change at least the specification of the dbm 
module? We could then later in 3.1 change the implementations to return 
iterators instead of lists, too.

I stumbled upon it cos I'm trying to help Skip with the SQLite-based 
implementation.

-- Gerhard
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4