Re: Varibles -- copies and references

2009-02-03 Thread Terry Reedy
Ferdinand Sousa wrote: Hi Some weeks back I had been following the thread "Why can't assign to function call". Today, I saw the "function scope" thread, and decided I should ask about the behaviour below: >>> # Simple va

Re: Varibles -- copies and references

2009-02-03 Thread Ferdinand Sousa
People get a confused because if you pass a mutable object inside a def function and mutate that object the changes /are/ propagated outside-- because now you have a name inside the function and a name outside the object both pointing to the same object. Since tuples are immutable, I guess pass

Re: Varibles -- copies and references

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 10:02 PM, Ferdinand Sousa wrote: > Hi > > Some weeks back I had been following the thread "Why can't assign to > function call". Today, I saw the "function scope" thread, and decided I > should ask about the behaviour below: >

Re: Varibles -- copies and references

2009-02-02 Thread Stephen Hansen
> > Guess the simple types show the expected behaviour (even though they are > technically instances of existing classes). The user defined classes seem to > be references/shallow copies. I prefer to avoid the term "reference" when talking about Python semantics, because it tends to make a lot of

Varibles -- copies and references

2009-02-02 Thread Ferdinand Sousa
Hi Some weeks back I had been following the thread "Why can't assign to function call". Today, I saw the "function scope" thread, and decided I should ask about the behaviour below: >>> # Simple variables >>>p=55 >>> q=p >>> q