Skip to content

Exception while trying the example on readme #52

@ndojibus

Description

@ndojibus

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions