您的位置:首页 > 编程语言 > Python开发

Python 中的 classmethod 和 staticmethod 有什么具体用途?

2016-01-26 13:48 597 查看
转自 http://www.zhihu.com/question/20021164
著作权归作者所有。

商业转载请联系作者获得授权,非商业转载请注明出处。

作者:bravez

链接:http://www.zhihu.com/question/20021164/answer/64413438

来源:知乎

1、先看:

Python 中的 classmethod 和 staticmethod 有什么具体用途? - 李保银的回答

讲明白了:@classmethod和@staticmethod是什么。

2、再看:

oop - Python @classmethod and @staticmethod for beginner?

讲明白了:什么时候用、怎么用。

3、继续:

oop - Python @classmethod and @staticmethod for beginner?

这个答案是对2的补充。

讲明白了:为什么要这么用。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: