On Apr 2, 10:13 am, Thomas Dimson <[EMAIL PROTECTED]> wrote: > > I guess my real question is: why does wrapping the call to be > "call=lambda x: DecorateMe.callMe(x)" somehow fix the issue with this > temporary namespace? It seems strange to me that defining an > additional function (through lambda) would allow me to see/add more > members to the namespace.
This works because of the very same mechanism that allows decorators to work. When the decorator in your example is called, it then evaluates the inner statements, including the creation of the function inner (the def ...). Similarly, when you do the lambda above, python points call to the lambda function, but does not evaluate it until later, when the youBet method is run. By the time youBet is run, the DecorateMe class exists, so this will properly evaluate. I hope the above is clear, I haven't had my coffee yet. regards, Erich -- http://mail.python.org/mailman/listinfo/python-list