Calling global functions from a class?

Robert Dailey rcdailey at gmail.com
Sat Sep 6 12:33:10 EDT 2008


HI,

I have the following python script:


def __normalizePath( path ):
    return osp.abspath( osp.normpath( path ) )

class AbsolutePath:
    def __init__( self, root="" ):
        _root = __normalizePath( root )


When I create an AbsolutePath object, I get the following error:

NameError: global name '_AbsolutePath__normalizePath' is not defined


Is there a reason for this? How can I make this work?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080906/d5799870/attachment.html>


More information about the Python-list mailing list