
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/
爱发电上赞助
By pythonhunter4.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/
爱发电上赞助

116 Listeners

327 Listeners

43 Listeners

463 Listeners

176 Listeners

25 Listeners

187 Listeners

55 Listeners

207 Listeners

35 Listeners

285 Listeners

314 Listeners

52 Listeners

45 Listeners

3 Listeners