[Python]Shallow and Deep copy operation
来源:互联网 发布:java实现基于链表的栈 编辑:程序博客网 时间:2024/05/16 00:34
The difference between shallow and deep copying is only relevant for compound objects (objects that contain other objects, like lists or class instances).
import copyclass MyKlass(object): def __init__(self,name): self.name = name def test(self): print "this is " + self.nameclass MyDict(dict): passdef myFunction(): print "this is function"if __name__ == '__main__': k = type(MyKlass) print k NewClass = copy.copy(MyKlass) NewClass("Python").test() d = type(MyDict) print d.__base__ f = type(myFunction) print f.__name__
0 0
- [Python]Shallow and Deep copy operation
- Python: Shallow and deep copy operations
- Deep Copy and Shallow Copy
- Shallow Copy and Deep Copy
- shallow copy and deep copy
- Deep copy and shallow copy
- deep copy and shallow copy
- difference between Python shallow copy and deep copy
- Java Clone, Shallow Copy and Deep Copy
- objective-c shallow- and deep-copy
- Deep copy & Shallow copy
- Shallow copy & Deep copy
- 深拷贝与浅拷贝(Deep Copy and Shallow Copy)
- 深拷贝与浅拷贝(Deep Copy and Shallow Copy)
- shallow copy and deep copy in Prototype Pattern
- shallow & deep copy
- Shallow vs. deep copy
- deep copy vs shallow copy
- IP及主机名设置_Linux运维笔记
- SPI内核驱动模型-dm8127
- addChildViewController、removeFromParentViewController等语法
- 查看TOMCAT内存使用情况 以及修改方法
- 泛型与容器(5)——总结
- [Python]Shallow and Deep copy operation
- 实现BorderLayout 布局
- Timer 只执行一次?怎么做呢?
- 计算sdcard上的剩余空间
- HDU 2768
- 从SEO来看,做网站该注意哪些基本要素
- 怎么获得android的近期任务列表?
- win7硬盘安装Centos 6.5 64位双系统
- MySQL Group By的优化