Re: [Tutor] Python Function Doubt

2009-05-26 Thread Alan Gauld
"nikhil" wrote Are objects for arguments, that persist between function calls, created during function definition ONLY when they have default values ? In Python the parameters are not objects but names. names are used to reference objects. If there is no default value then there is no objec

Re: [Tutor] Python Function Doubt

2009-05-26 Thread spir
Le Tue, 26 May 2009 19:42:34 +0530, nikhil s'exprima ainsi: > Hi, > > Thanks for reply. > > I went through the link you provided. It was very helpful. > > What I understood is this, > > --> Objects are created for default argument types, inside the function > object. ... for default argument

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Dave Angel
nikhil wrote: Hi, I am learning Python and came across this example in the Python Online Tutorial ( http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3)

Re: [Tutor] Python Function Doubt

2009-05-26 Thread nikhil
Hi, Thanks for reply. I went through the link you provided. It was very helpful. What I understood is this, --> Objects are created for default argument types, inside the function object. This happens only once when the function definition statement is executed. These objects persist

Re: [Tutor] Python Function Doubt

2009-05-26 Thread Christian Witts
nikhil wrote: Hi, I am learning Python and came across this example in the Python Online Tutorial (http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3)

[Tutor] Python Function Doubt

2009-05-26 Thread nikhil
Hi, I am learning Python and came across this example in the Python Online Tutorial ( http://docs.python.org/tutorial/controlflow.html#default-argument-values) for Default Argument Values. ex: def func(a, L=[ ]): L.append(a) return L print func(1) print func(2) print func(3) *O/P* [1] [1,2] [