Why are functions atomic?

Chris Mellon arkanes at gmail.com
Fri May 4 16:07:52 EDT 2007


On 4 May 2007 12:55:03 -0700, Michael <michael.forbes at gmail.com> wrote:
> On May 4, 5:49 am, "Chris Mellon" <arka... at gmail.com> wrote:
> > You aren't getting "bit" by any problem with closures - this is a
> > syntax problem.
>
> I understand that it is not closures that are specifically biting me.
> However, I got bit, it was unplesant and I don't want to be bit
> again;-)
>
> Thus, whenever I need to pass information to a function, I use default
> arguments now.  Is there any reason not to do this other than the fact
> that it is a bit more typing?
>

There are different semantics when the thing you're passing is
mutable. There's also different semantics when it's rebound within the
calling scope, but then the default argument technique is probably
what you want.

> Michael
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list