patx / pickledb

pickleDB is an open source key-value store using Python's json module.
https://patx.github.io/pickledb
BSD 3-Clause "New" or "Revised" License
925 stars 125 forks source link

lgetall leaks the db abstraction #74

Open sagi-schein opened 3 years ago

sagi-schein commented 3 years ago

when you do a db.lgetall("key") you actually get a list that is the same stored list in the db. now when doing a list.pop() yo actually modify the db itself outside of its API. this is a bad abstraction leak even if there is some performance reason to it. much better to return a copy()