Dennis Lee Bieber wrote:
> On 16 Dec 2006 14:49:19 -0800, "jansenh" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > Yes.
> > [... the temp object is by ref, and any manipulation of the temp object
> > is to the object itself..? It really simplifies my first attempt]
> >
>       For all practical purposes, everything in Python is "by ref" and the
> difference is whether the object itself is mutable (dictionaries, lists,
> class instances, modules) or immutable (strings, tuples, numbers). A
> mutable object is basically something that contains references to other
> objects

Not at all.  It's not even generally true of Python.  Mutability is
orthogonal to containership.

arrays, files, cStringIO objects, mmap objects, thread locks, some
iterator types, etc., are mutable but do not contain Python objects
(__dict__ excepted).

tuples, frozensets, instancemethods, are immutable but do contain
Python objects.


Carl Banks

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to