On Tue, Sep 29, 2009 at 9:41 PM, Chris Rebert <c...@rebertia.com> wrote:
> On Tue, Sep 29, 2009 at 9:15 PM, Rich Healey <healey.r...@gmail.com> wrote:
>> However:
>>
>> def callonce(func):
>>    def nullmethod(): pass
>>    def __():
>>        return func()
>>        func = nullmethod

Additionally, to rebind a variable in an outer nested function scope
like you tried to do, you'd need a `nonlocal` statement. See
http://www.python.org/dev/peps/pep-3104/

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to