In <[email protected]> "Diez B. Roggisch" <[email protected]> 
writes:

>But if you insist on the above methodology, you can do this:

>class Demo(object):

>    def fact(n):
>        def inner(n):
>            if n < 2:
>                return 1
>            else:
>                return n * inner(n - 1)
>        return inner(n)

>    _classvar = fact(5)

>This makes inner a *local* variable, which is found.

Thanks for this.  I think this is the most straightforward workaround.

kynn
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to