classmethod&staticmethod, shallow copy

classmethod: 函数对本类进行处理
staticmethod: 函数不对本类里面的参数做处理

https://www.programiz.com/python-programming/methods/built-in/staticmethod
https://www.programiz.com/python-programming/methods/built-in/classmethod

浅复制: 对于不可变对象会开辟新空间,可变对象直接引用

猜你喜欢

转载自www.cnblogs.com/luxuriance-lily/p/10723195.html