On 21 Apr, 12:36, Chris Rebert <c...@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 -- http://mail.python.org/mailman/listinfo/python-list