[Python-Dev] Python 3.0: can we make dbm's .keys() return an iterator? (original) (raw)
Gerhard Häring gh at ghaering.de
Thu Sep 11 11:40:59 CEST 2008
- Previous message: [Python-Dev] new ssl module is incompatible with servers that drop privileges
- Next message: [Python-Dev] Python 3.0: can we make dbm's .keys() return an iterator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] new ssl module is incompatible with servers that drop privileges
- Next message: [Python-Dev] Python 3.0: can we make dbm's .keys() return an iterator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]