defaults for function arguments bound only once(??)

2009-10-04 Thread horos11
All, Another one, this time a bit shorter. It looks like defaults for arguments are only bound once, and every subsequent call reuses the first reference created. Hence the following will print '[10,2]' instead of the expected '[1,2]'. Now my question - exactly why is 'default_me()' only called

Re: defaults for function arguments bound only once(??)

2009-10-04 Thread Chris Rebert
On Sat, Oct 3, 2009 at 11:29 PM, horos11 horo...@gmail.com wrote: All, Another one, this time a bit shorter. It looks like defaults for arguments are only bound once, and every subsequent call reuses the first reference created. Hence the following will print '[10,2]' instead of the

Re: defaults for function arguments bound only once(??)

2009-10-04 Thread Simon Forman
On Sun, Oct 4, 2009 at 2:29 AM, horos11 horo...@gmail.com wrote: All, Another one, this time a bit shorter. It looks like defaults for arguments are only bound once, and every subsequent call reuses the first reference created. Hence the following will print '[10,2]' instead of the expected