references ???

Thomas Weidner wolf359_ at gmx.net
Fri Nov 2 08:36:42 EST 2001


In <9rtpsc$13j2 at newton.cc.rl.ac.uk>, Richard Brodie wrote:


> "Thomas Weidner" <wolf359_ at gmx.net> wrote in message
> news:pan.2001.11.01.17.30.27.280.2271 at gmx.net...
> 
> 
>> I think anybody here knows what references,like in java,c++ or perl,
>> are. How can i use references in python ?
> 
> Implicitly. Consider the following:
> 
>>>> a = [1,2,3]
>>>> b = a
>>>> b[1] = 20
>>>> print a
> [1, 20, 3]

Interesting....
Is this also possible for single values like ints ?
How do i make clear if i want a copy of a or a reference to it ?



More information about the Python-list mailing list