indirect references

Erno Kuusela erno at iki.fi
Mon Jun 5 22:23:40 EDT 2000


>>>>> "Thomas" == Thomas Wouters <thomas at xs4all.net> writes:

    Thomas> On Mon, Jun 05, 2000 at 04:13:30PM -0700, Sean 'Shaleh'
    Thomas> Perry wrote:

    >> I knew that a string itself was immutable, I guess I was
    >> looking for a reference object of some kind (a la C pointers,
    >> C++/perl references).

    Thomas> Well, if you wanted a reference, you got it :)

    Thomas> foo = "string" bar = foo

if you had an immutable object in c or perl, and you wannted to share
a reference to it from 2 locations but change it from either one, you
would use a reference to a reference - but that doesn't exist in
python. so you have to use some kind of mutable container object.

  -- erno



More information about the Python-list mailing list