
Sign up to save your podcasts
Or
本期中的问题可在这里找到:
01:49:40 关于「unbound method 在 Python 3 中为什么会取消」的讨论。
关于 unbound method 取消的原因,我没找到官方的解释,很多人说是为了简化语言,因为区分 function 和 unbound method 意义不大。然后我们关于 @staticmethod 那里说错了。@staticmethod 在 Python 3 里还是需要的,因为只有你在 MyClass.some_method 才是和 @staticmethod 等价,然而很多时候我们需要在 instance 上调用,这时候还是需要 @staticmethod。
[16]: https://www.python.org/dev/peps/pep-0572/
爱发电上赞助
4.3
2929 ratings
本期中的问题可在这里找到:
01:49:40 关于「unbound method 在 Python 3 中为什么会取消」的讨论。
关于 unbound method 取消的原因,我没找到官方的解释,很多人说是为了简化语言,因为区分 function 和 unbound method 意义不大。然后我们关于 @staticmethod 那里说错了。@staticmethod 在 Python 3 里还是需要的,因为只有你在 MyClass.some_method 才是和 @staticmethod 等价,然而很多时候我们需要在 instance 上调用,这时候还是需要 @staticmethod。
[16]: https://www.python.org/dev/peps/pep-0572/
爱发电上赞助
109 Listeners
320 Listeners
43 Listeners
24 Listeners
456 Listeners
176 Listeners
184 Listeners
53 Listeners
207 Listeners
35 Listeners
272 Listeners
51 Listeners
291 Listeners
45 Listeners
3 Listeners