2006年07月18日 星期二 14:43
有什么办法可以deepcopy一个class?
2006年07月18日 星期二 14:48
Python帮助――库参考手册: 3.18 copy -- Shallow and deep copy operations This module provides generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.error is raised. 在06-7-18,linda. s <samrobertsmith at gmail.com> 写道: > > 有什么办法可以deepcopy一个class? > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- 欢迎访问: http://blog.csdn.net/ccat 刘鑫 March.Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060718/4b8270ce/attachment.htm
2006年07月18日 星期二 15:16
好象不能深COPY CLASS滴,有什么类似的办法吗? This version does not copy types like module, class, function, method, stack trace, stack frame, file, socket, window, array, or any similar types. On 7/17/06, 刘鑫 <march.liu at gmail.com> wrote: > Python帮助――库参考手册: > > > 3.18 copy -- Shallow and deep copy operations > > > > This module provides generic (shallow and deep) copying operations. > > Interface summary: > > > import copy > > x = copy.copy(y) # make a shallow copy of y > x = copy.deepcopy(y) # make a deep copy of y > > For module specific errors, copy.error is raised. > > 在06-7-18,linda. s <samrobertsmith at gmail.com> 写道: > > 有什么办法可以deepcopy一个class? > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > -- > 欢迎访问: > http://blog.csdn.net/ccat > > 刘鑫 > March.Liu > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >
2006年07月18日 星期二 15:22
CLASS需要深Copy吗?你在里面加入了静态变量?从语法角度讲,一份Class的copy本身就是一个奇怪的概念……如果你真的需要,自己用Type的底层方法去构造吧,我想,应该有办法的。 感觉copy class像是一个原型模式的特殊实现方法?或者,类工厂? 在06-7-18,linda. s <samrobertsmith at gmail.com> 写道: > > 好象不能深COPY CLASS滴,有什么类似的办法吗? > This version does not copy types like module, class, function, method, > stack trace, stack frame, file, socket, window, array, or any similar > types. > > On 7/17/06, 刘鑫 <march.liu at gmail.com> wrote: > > Python帮助――库参考手册: > > > > > > 3.18 copy -- Shallow and deep copy operations > > > > > > > > This module provides generic (shallow and deep) copying operations. > > > > Interface summary: > > > > > > import copy > > > > x = copy.copy(y) # make a shallow copy of y > > x = copy.deepcopy(y) # make a deep copy of y > > > > For module specific errors, copy.error is raised. > > > > 在06-7-18,linda. s <samrobertsmith at gmail.com> 写道: > > > 有什么办法可以deepcopy一个class? > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > -- > > 欢迎访问: > > http://blog.csdn.net/ccat > > > > 刘鑫 > > March.Liu > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- 欢迎访问: http://blog.csdn.net/ccat 刘鑫 March.Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060718/87acaef6/attachment.html
Zeuux © 2025
京ICP备05028076号