shove does not store data as expected

Alex metallourlante at gmail.com
Wed Apr 21 13:37:45 CEST 2010


On 21 Apr, 12:36, Chris Rebert <c... at rebertia.com> wrote:
[cut]
>
> Explanation:
> The explicit assignment back to the `store` pseudo-dictionary lets it
> properly update its internal state to reflect the change to the value
> (in this case, the list) associated with the region key. In your
> original version, you merely modified the list in-place, and (due to
> the way Python works) `store` has no way of knowing that you've done
> that and thus doesn't do the necessary bookkeeping, hence the behavior
> you're observing.
>
> See also:http://docs.python.org/library/shelve.html#example
>
> And further note that shove seems to be beta and (apart from
> docstrings in the source code) undocumented.

Thanks a lot for the clear explanation. It works!
I will read the docs more carefully next time :-)

Alex



More information about the Python-list mailing list