I have a module that looks something like this:
def __myFunc():
...
class MyClass(object):
def __init__(self):
self.myVar = __myFunc()
and I get the error:
NameError: global name '_MyClass__myFunc' is not defined
How can I call this function from inside the class?
edit: Since posting this, I've discovered I can avoid the automatic mangling by using a single underscore instead of double underscores. I was using two as per http://diveintopython.org/object_oriented_framework/private_functions.html, which only states a double underscore denotes private functions.