Ok, So I am seeing something weird and I think I misunderstood how to pass functions around in python..
class Foo:
def execute(self, **kwargs):
print "self is ", self # <foo.Foo object at 0x1012948d0>
features = {func_name: feature_func(kwargs, arg=arg)for func_name,
feature_func in Foo.ALGORITHMS.items()}
def func1(self, **kwargs):
print "self is " , self # prints {}
self._funchelp()
def __funchelp(self):
# pass
ALGORITHMS = {'func1': func1}
So, what I am not getting is why is self printing to be an empty dictionary??
features = {func_name: feature_func(kwargs, arg=arg)for func_name,
feature_func in Foo.ALGORITHMS.items()}
Something gets messed up above
And then
self._funchelp()
Returns AttributeError: 'dict' object has no attribute '_Foo__funchelp'