I'm passing a function as a parameter to a class constructor. The constructor stores it in an instance variable, and other class methods want to call it.

```
class ComboList(list) :
    def __init__(self,a,b,kg) :
        list.__init__(self)
        self.__kg = kg
        # More stuff follows

```

When I try to call the function in another method, for example:

```
x = self.__kg('a')

```

I get "{AttributeError}'' object has no attribute '\_\_kg'."

When I evaluate the function call in my IDE's Evaluate Expression window, I get the same thing. But when I evaluate the instance variable itself ("self.\_\_kg"), I get:

```
result = {function} <function <lambda> at 0x0000000002ED5C18>

```

...so it appears that the attribute \_\_kg *is* defined.

What is going wrong?

I can call the function by referencing the parameter -- no problem.

```
kg(a')

```

I can also assign the parameter's value to a method variable and call the variable -- no problem.

```
_kag = kg
_kag('a')

```

It's only the reference to the instance variable that doesn't work.