All pastes #2072442 Raw Edit

Someone

public python v1 · immutable
#2072442 ·published 2011-05-30 19:50 UTC
rendered paste body
class A(object):        i = 1        def print_i(self):                print 'In A.print_i() self.i is', self.i                # this prints correctlyclass B(A):        def vals(self):                print 'super(B, self).print_i()', super(B, self).print_i()                # The above statement prints correctly. I walk through                # it with a debugger, after print_i() returns, but before                # this method returns, 'None' is printed. Why?if __name__ == '__main__':        b = B()        b.vals()        print '###'Example output:super(B, self).print_i() In A.print_i() self.i is 1None###