class Phone: IMEI=2020001 producer="apple" def call_by_4g(self): print("4g通话") class MyPhone2(Phone): IMEI = 2023001 producer = "banana" def call_by_4g(self): old_return_value=super().call_by_4g() print("原始的厂商:"+super().producer) return old_return_value #实例化某个对象 phone2=MyPhone2() phone2.call_by_4g()# 老的call_by_4g 方法返回值 '''
4g通话
原始的厂商:apple
'''
标签:return,producer,子类,old,call,4g,父类,119 From: https://www.cnblogs.com/haha1988/p/17533442.html