Re: variable & scoping question.

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 08:46:17 -0700, Cornelius Keller wrote: > On 10 Aug., 17:12, "Diez B. Roggisch" wrote: >> Cornelius Keller wrote: > [snip] >> >> http://effbot.org/zone/default-values.htm >> >> Diez > > Ok thank you. > I' understand now why. > I still think this is very confusing, because def

Re: variable & scoping question.

2009-08-10 Thread J. Cliff Dyer
On Mon, 2009-08-10 at 08:46 -0700, Cornelius Keller wrote: > On 10 Aug., 17:12, "Diez B. Roggisch" wrote: > > Cornelius Keller wrote: > [snip] > > > > http://effbot.org/zone/default-values.htm > > > > Diez > > Ok thank you. > I' understand now why. > I still think this is very confusing, because

Re: variable & scoping question.

2009-08-10 Thread Ethan Furman
Cornelius Keller wrote: [snip] I still think this is very confusing, because default values don't behave like most people would expect without reading the docs. - Cornelius Why would you expect to become a good programmer of _any_ language without reading its docs? ~Ethan~ -- http://mail.p

Re: variable & scoping question.

2009-08-10 Thread MRAB
Francesco Bochicchio wrote: On Aug 10, 5:12 pm, "Diez B. Roggisch" wrote: Cornelius Keller wrote: Hi, I'm a quite fresh python programmer, (6 Month python experience). Today I found something I absolotly don'nt understand: given the following function: def test_effect(class_id=None,class_ids=[

Re: variable & scoping question.

2009-08-10 Thread Cornelius Keller
On 10 Aug., 17:12, "Diez B. Roggisch" wrote: > Cornelius Keller wrote: [snip] > > http://effbot.org/zone/default-values.htm > > Diez Ok thank you. I' understand now why. I still think this is very confusing, because default values don't behave like most people would expect without reading the doc

Re: variable & scoping question.

2009-08-10 Thread Francesco Bochicchio
On Aug 10, 5:12 pm, "Diez B. Roggisch" wrote: > Cornelius Keller wrote: > > Hi, > > > I'm a quite fresh python programmer, (6 Month python experience). > > Today I found something I absolotly don'nt understand: > > > given the following function: > > > def test_effect(class_id=None,class_ids=[]):

Re: variable & scoping question.

2009-08-10 Thread Diez B. Roggisch
Cornelius Keller wrote: > Hi, > > I'm a quite fresh python programmer, (6 Month python experience). > Today I found something I absolotly don'nt understand: > > given the following function: > > def test_effect(class_id=None,class_ids=[]): >     if class_id is not None: >         if class_id no

variable & scoping question.

2009-08-10 Thread Cornelius Keller
Hi, I'm a quite fresh python programmer, (6 Month python experience). Today I found something I absolotly don'nt understand: given the following function: def test_effect(class_id=None,class_ids=[]): if class_id is not None: if class_id not in class_ids: class_ids.append(