Need help with Python scoping rules

Stephen Fairchild somebody at somewhere.com
Thu Aug 27 04:10:46 EDT 2009


kj wrote:

> Because, as I've explained elsewhere, it is not a method: it's a
> "helper" function, meant to be called only once, within the class
> statement itself.

So why didn't you delete it after you were done with it?

Class Demo(object):
    def fact(x):
        ...

    _classvar = fact(5)
    del fact()
-- 
Stephen Fairchild



More information about the Python-list mailing list