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

make api more python3-dict-like #13

Open
3 tasks done
ThomasWaldmann opened this issue Oct 25, 2024 · 1 comment
Open
3 tasks done

make api more python3-dict-like #13

ThomasWaldmann opened this issue Oct 25, 2024 · 1 comment
Assignees

Comments

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Oct 25, 2024

the current api is not quite like a dictionary, but rather like borgbackup's hashindex api is like.

considering that borgbackup has a wrapper class around borghash classes anyway, we can change borghash api to be more like python3 dict api.

maybe not implement everything, but name the frequently used stuff as usual:

  • .iteritems -> .items
  • __init__: make all special stuff pure kwargs
  • .update
  • also implement __iter__, .keys and .values

Check:

@ThomasWaldmann
Copy link
Member Author

Note: subclassing from collections.abc.MutableMapping didn't work.

Cython complained (IIRC) that this is not an extension class.

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