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

Exception while trying the example on readme #52

Open
ndojibus opened this issue Jan 3, 2023 · 0 comments
Open

Exception while trying the example on readme #52

ndojibus opened this issue Jan 3, 2023 · 0 comments

Comments

@ndojibus
Copy link

ndojibus commented Jan 3, 2023

Hello

I got an exception while trying the example on duplicates.
When reassigning a duplicate and after printing the duplicate, get_all_for('key') fails with


>>> d[(1, 'key')] = 123  # reassign specific duplicate
>>> d.get_all_for('key')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python310\lib\site-packages\vdf\vdict.py", line 190, in get_all_for
    return [self[(idx, key)] for idx in _range(self.__kcount[key])]
  File "C:\Program Files\Python310\lib\site-packages\vdf\vdict.py", line 190, in <listcomp>
    return [self[(idx, key)] for idx in _range(self.__kcount[key])]
  File "C:\Program Files\Python310\lib\site-packages\vdf\vdict.py", line 87, in __getitem__
    return super(VDFDict, self).__getitem__(self._normalize_key(key))
KeyError: (2, 'key')

is it a bug or the examples are not up to date?

@ndojibus ndojibus changed the title Example on readme not accurate Exception while trying the example on readme Jan 3, 2023
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