python
蔷薇枝
这个作者很懒,什么都没留下…
展开
-
[MEMO] Python argument passing
For memo. 如有错误或不当之处,还请帮忙指出。eg1:a=[2,3,4];def modify(x): x.append('x') return xprint (modify(a))print(a)result:[2, 3, 4, 'x'][2, 3, 4, 'x']可以看到a 最后确实被修改。 passing parameters by ob原创 2015-07-15 23:35:28 · 665 阅读 · 0 评论 -
Python-Beyond the Basics--Inheritance & Subtype Polymorphism
最近在看pluralsight的 python- beyond the basics 教程,学到好多东西。在这里记一下。本节讲的是继承相关的知识。Method Resolution Order1. 定义MRO 指明了在继承中,当类本身和基类中同时有多个同名函数定义的时候,应该如何查找最终智行的函数。本身是ordering of the inheritance graph.原创 2016-08-29 19:05:46 · 618 阅读 · 0 评论