區別:
函數在類體之外定義,參數中不含有關鍵字self;
方法在類體內部定義,參數中含有關鍵字self。
聯繫:
都是用關鍵字def做開始部分定義
區別:
函數在類體之外定義,參數中不含有關鍵字self;
方法在類體內部定義,參數中含有關鍵字self。
聯繫:
都是用關鍵字def做開始部分定義
class MetaCls(type): def __new__(cls, *args, **kwargs): print("in MetaCls") # return super(Meta