
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/
爱发电上赞助
119 Listeners
107 Listeners
317 Listeners
24 Listeners
444 Listeners
175 Listeners
164 Listeners
50 Listeners
273 Listeners
300 Listeners
23 Listeners
288 Listeners
27 Listeners
9 Listeners
2 Listeners