Python function not being called

I have a python class and couple of functions, 1st calling 2nd. However, 2nd is never getting called. Also the line after _method2() invocation is never executed.

    class call_methods():


        def _method1(self,context):

            print "Now call method 2";  

            this._method2(context);

            print "Finish"; 

            return {}


        def _method2(context={}):

            print "method 2 called"


            return {}

Output:

            Now call method 2

Only 1st print statement comes out.

The question is similar to Function Not getting called but solution suggested there doesn’t seem to apply to this.


Source: python

Leave a Reply