Automatic debugging of copy by reference errors?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Dec 11 10:15:07 EST 2006


In <1165846864.970968.78750 at 79g2000cws.googlegroups.com>, Beliavsky wrote:

>> ISTM the big catch for Fortran programmers is when a mutable container
>> is referenced from multiple places; thus a change via one reference
>> will confusingly show up via the other one.
> 
> As a Fortranner, I agree. Is there an explanation online of why Python
> treats lists the way it does? I did not see this question in the Python
> FAQs at http://www.python.org/doc/faq/ .

This question sounds as if lists are treated somehow special.  They are
treated like any other object in Python.  Any assignment binds an object
to a name or puts a reference into a "container" object.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list