Skip to content
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

get_storage() is not a very complete implementation of dict() #118

Open
auspex opened this issue Oct 21, 2014 · 1 comment
Open

get_storage() is not a very complete implementation of dict() #118

auspex opened this issue Oct 21, 2014 · 1 comment

Comments

@auspex
Copy link

auspex commented Oct 21, 2014

get_storage() doesn't implement some of the basic methods of a dictionary.

I haven't actually got to putting anything into the storage, yet, but on an empty storage:

    storage = plugin.get_storage('store')
    if storage:
        ...

results in:
TypeError: an integer is required
as does len(storage)

Also, it has no 'viewitems', 'fromkeys', 'viewvalues', '__cmp__', '__le__', 'has_key', 'viewkeys', '__gt__', '__lt__', 'copy', '__ge__' methods.

Most importantly, I need has_key — and contains() provides the correct functionality, so why not just implement has_key()?

@auspex
Copy link
Author

auspex commented Oct 21, 2014

OK, these look pretty trivial. I've forked your repository and already fixed len() and has_key(). I'll see about the rest but submit a pull request for those, at least, today or tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant