IronPython中的深度复制

时间:2010-06-07 17:47:09

标签: .net ironpython deep-copy

我想在IronPython中进行深度复制,但是当我写

import copy 

我得到no module named copy

  

如何在IronPython中进行深度复制?

1 个答案:

答案 0 :(得分:5)

使用IronPython version 2.6.1,然后在安装程序中选择标准库选项。 我安装的一个例子:

IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927
Type "help", "copyright", "credits" or "license" for more information.
>>> import copy
>>> help(copy.deepcopy)
Help on function deepcopy in module copy:

deepcopy(x, memo=None, _nil=[])
    Deep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.

>>> copy.deepcopy(range(5))
[0, 1, 2, 3, 4]
>>>