ronny-rentner / UltraDict

Sychronized, streaming Python dictionary that uses shared memory as a backend
Apache License 2.0
272 stars 25 forks source link

Problem updating iterating on values #8

Closed hugo3m closed 2 years ago

hugo3m commented 2 years ago

Hi! i started using your dictionary in my project however I found a bug while trying to iterate on the dictionary values. Those few lines of code trigger the bug.

Screenshot from 2022-05-17 12-15-58 .

It can be solve by applying apply_update before trying to iterate on the values, however the function is already called by the same process before trying to iterate (I added a print) so I do not really understand why is it solving it. However I'm probably going to iterate over keys instead, trying to bypass it by iterating over items but it is not working too :-)

ronny-rentner commented 2 years ago

Hi @hugo3m

Many thanks for your bug report. This should be easy to fix. I'll look into it later today. I suspect it is happening because I have not implement the __iter__() method yet.

hugo3m commented 2 years ago

Thank you for your quick reply, I look forward to reading your update

ronny-rentner commented 2 years ago

As suspected, it was the missing __iter__() method. Please check the dev branch and let me know if this fixes your problem.

hugo3m commented 2 years ago

It fixes my problem ! Thank you, I can write quick unit test if you want

ronny-rentner commented 2 years ago

Thanks a lot for your feedback and your offer. Much appreciated!

Though, I already took the chance to create a new unit test for this issue. It's in the commit above. ;)