python类 super方法获得父类定义

 

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author:albert time:2019/4/18 0018


class A:

    def say(self):
        print('A')


class B(A):

    def say(self):
        # A.say(self)
        super().say()
        print('B')

B().say()

 

posted @ 2019-04-18 20:25  文二1234  阅读(424)  评论(0编辑  收藏  举报