copy-on-write for dict objects?

Michael Hudson mwh at
Thu Jan 16 17:19:39 CET 2003

Matthias Oberlaender <matthias.oberlaender at> writes:

> In <7h34r89p3wp.fsf at> Michael Hudson wrote:
> <snip>  my stuff deleted 
> > 
> > You *could* try this (untested):

*my* stuff deleted.

> Another problem with all these approaches is that they introduce a
> level of indirection. For example, I use to write 'k in d' in my
> code (which seems to be even faster than 'd.has_key(k)'.  If this
> has to go through a method of my own, the speed penalty is
> significant.

Only until the copy happens, though.  Urgh, actually not in the code I
posted, but that's easy.  Better than nothing?


  Darned confusing, unless you have that magic ingredient coffee, of
  which I can pay you Tuesday for a couple pounds of extra-special
  grind today.                           -- John Mitchell, 11 Jan 1999

More information about the Python-list mailing list