多态

    多态的概念是应用于java和C#这一类强类型语言中,而python推崇“鸭子类型”

    所谓多态:定义时的类型和运行时的类型不一样,此时就成为多态

    *python伪代码实现java或者c#的多态

class F1(object):
    def show(self):
        print'F1.show'
class S1(F1):
    def show(self):
        print'S1.show'
class S2(F1):
    def show(self):
        print'S2.show'

   #由于在java或者c#中定义函数参考时,必须指定参数的类型

   实际传入的参数:S1对象和S2对象

   待补充~

原文地址:https://www.cnblogs.com/FlameLuo/p/9736257.html