Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-13 Thread Nigel Rantor
Jonathan Gardner wrote: [...eloquent and interesting discussion of variable system snipped...] > Is Python's variable system better than perl's? It depends on which way you prefer. As for me, being a long-time veteran of perl and Python, I don't think having a complicated variable system such as

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-13 Thread Palindrom
On Aug 13, 2:12 am, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Aug 12, 9:17 am, Palindrom <[EMAIL PROTECTED]> wrote: > > > > > Hi everyone ! > > > I'd like to apologize in advance for my bad english, it's not my > > mother tongue... > > > My girlfriend (who is a newbie in Python, but knows Pe

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Jonathan Gardner
On Aug 12, 9:17 am, Palindrom <[EMAIL PROTECTED]> wrote: > Hi everyone ! > > I'd like to apologize in advance for my bad english, it's not my > mother tongue... > > My girlfriend (who is a newbie in Python, but knows Perl quite well) > asked me this morning why the following code snippets didn't gi

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Demarche Bruno
Thank you both for your reply ! On Tue, Aug 12, 2008 at 8:52 PM, Demarche Bruno <[EMAIL PROTECTED]> wrote: > Thank you Nigel, it's clearer for both of us now. > I think wat confused her is the fact that : > > L = [1,2,3] > def foo(my_list): >my_list.append(4) > > will modify L, while the follo

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Demarche Bruno
Thank you Nigel, it's clearer for both of us now. I think wat confused her is the fact that : L = [1,2,3] def foo(my_list): my_list.append(4) will modify L, while the following: L = [1,2,3] def foo(my_list): my_list = [1,2,3,4] will not. On Tue, Aug 12, 2008 at 6:46 PM, Nigel Rantor <[

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Nigel Rantor
Palindrom wrote: ### Python ### liste = [1,2,3] def foo( my_list ): my_list = [] The above points the my_list reference at a different object. In this case a newly created list. It does not modify the liste object, it points my_list to a completely different object. ### Perl ### @ls

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Palindrom <[EMAIL PROTECTED]> wrote: > Hi everyone ! > > I'd like to apologize in advance for my bad english, it's not my > mother tongue... > > My girlfriend (who is a newbie in Python, but knows Perl quite well) > asked me this morning why the following code s

How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Palindrom
Hi everyone ! I'd like to apologize in advance for my bad english, it's not my mother tongue... My girlfriend (who is a newbie in Python, but knows Perl quite well) asked me this morning why the following code snippets didn't give the same result : ### Python ### liste = [1,2,3] def foo( my_li