New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more dict methods to dbm interfaces #50295
Comments
All the dbm.* modules currently have different interfaces, and different For example, both dbm.gnu and dbm.ndbm only have keys() methods, and So, either we remove the claim that they have a dict-style interface |
I disagree that this is release-critical. I think it is desirable to The problem with the current documentation is that it apparently stopped http://www.python.org/doc/2.5/lib/typesmapping.html did. Instead, the documentation now only documents the dict type itself. |
First, lowering priority.
Supporting only __getitem__, __setitem__, __delitem__, __contains__ and
It should first be decided what a "dict-style interface" means in Python However, for the dbm modules I would be in favor of only specifying the |
It's also __len__... Indeed, I think that this is the major part of the
I don't mind the documentation to explain precisely what is, as long as |
Would inheriting from MutableMapping fix this problem? |
In principle: some of it, yes. These types are written in C, |
I suspect that for most users, shelve is the main way they will access Note: bpo-5736 aims to make dbm.* support the iterator protocol, which The dbm.* docs could also explicitly tell users who want a *complete* |
r87013 adds get() and setdefault() to dbm.gnu -- now gdbm and ndbm have the same set of dict methods available. For me, that is enough to demote this to feature request. There's another issue anyway for iteration protocol support. |
See also bpo-9523. |
I believe this is now superseded by bpo-9523, which has less discussion but a patch. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: