Python重写父类方法__len__

class Liar(list):
    
    def __len__(self):
        return super().__len__() + 3 # 直接写 super().__len__()  而没有 return 不会返回 length !

a = Liar(['a','b'])
原文地址:https://www.cnblogs.com/yaos/p/7072700.html