awolverp / cachebox

The fastest memoizing and caching Python library written in Rust.
https://pypi.org/project/cachebox/
MIT License
258 stars 4 forks source link

[Feature] ReadOnly caches #6

Closed owocado closed 3 months ago

owocado commented 4 months ago

hello and greetings,

I have recently stumbled upon cachebox and I found it to be extremely useful library for assigning large cache of objects at much lower memory footprint. So thank you so much for making this public. :D

My question is whether there is a way currently to make Cache class read only? My use case is that I assign few variables as constants at module level in my project that should not allow any modification or mutation after assignment to prevent weird edge cases. I am using MappingProxyType for now which is in python stdlib but I find it to be rather slow on large dictionaries so this is why I opened this issue.

Thanks for reading and wish you a great day!

awolverp commented 4 months ago

Hello and thank you for your good idea

I will add read only caches to library as soon as possible :)

owocado commented 4 months ago

Thank you very much for the prompt response. I will look forward to it, no rush ofcourse, when you can. :D

owocado commented 3 months ago

oh sweet, thank you @awolverp for doing this and wish you a great weekend 😄