Re: scope of function parameters (take two)

2011-05-31 Thread Henry Olders
On 2011-05-31, at 24:35 , Dan Stromberg wrote: > > On Mon, May 30, 2011 at 5:28 PM, Henry Olders wrote: > > Be careful not to conflate global scoping or global lifetime, with mutability > or pure, side-effect-free functions (callables). It sounds like what you > want is i

Re: scope of function parameters (take two)

2011-05-31 Thread Henry Olders
On 2011-05-30, at 20:52 , Benjamin Kaplan wrote: > On Mon, May 30, 2011 at 5:28 PM, Henry Olders wrote: >> >> On 2011-05-29, at 4:30 , Henry Olders wrote: >> > > Python doesn't have true globals. When we say "global" what we mean is > "modul

Re: scope of function parameters (take two)

2011-05-30 Thread Henry Olders
On 2011-05-31, at 1:13 , Wolfgang Rohdewald wrote: > > what you really seem to want is that a function by default > cannot have any side effects (you have a side effect if a > function changes things outside of its local scope). But > that would be a very different language than python You're pa

Re: scope of function parameters (take two)

2011-05-30 Thread Henry Olders
On 2011-05-29, at 4:30 , Henry Olders wrote: > I just spent a considerable amount of time and effort debugging a program. > The made-up code snippet below illustrates the problem I encountered: > > def main(): > a = ['a list','with','three element

Re: scope of function parameters

2011-05-29 Thread Henry Olders
Henry On 2011-05-29, at 5:47 , Wolfgang Rohdewald wrote: > On Sonntag 29 Mai 2011, Henry Olders wrote: >> It seems that in Python, a variable inside a function is >> global unless it's assigned. > > no, they are local > >> I would have thou

scope of function parameters

2011-05-29 Thread Henry Olders
I just spent a considerable amount of time and effort debugging a program. The made-up code snippet below illustrates the problem I encountered: def main(): a = ['a list','with','three elements'] print a print fnc1(a) print a def fnc1(b): return fn