当前位置: 首页>>代码示例>>Python>>正文


Python sharedctypes.copy方法代码示例

本文整理汇总了Python中multiprocessing.sharedctypes.copy方法的典型用法代码示例。如果您正苦于以下问题:Python sharedctypes.copy方法的具体用法?Python sharedctypes.copy怎么用?Python sharedctypes.copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing.sharedctypes的用法示例。


在下文中一共展示了sharedctypes.copy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_dict

# 需要导入模块: from multiprocessing import sharedctypes [as 别名]
# 或者: from multiprocessing.sharedctypes import copy [as 别名]
def test_dict(self):
        d = self.dict()
        indices = range(65, 70)
        for i in indices:
            d[i] = chr(i)
        self.assertEqual(d.copy(), dict((i, chr(i)) for i in indices))
        self.assertEqual(sorted(d.keys()), indices)
        self.assertEqual(sorted(d.values()), [chr(i) for i in indices])
        self.assertEqual(sorted(d.items()), [(i, chr(i)) for i in indices]) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:11,代码来源:test_multiprocessing.py

示例2: test_copy

# 需要导入模块: from multiprocessing import sharedctypes [as 别名]
# 或者: from multiprocessing.sharedctypes import copy [as 别名]
def test_copy(self):
        foo = _Foo(2, 5.0)
        bar = copy(foo)
        foo.x = 0
        foo.y = 0
        self.assertEqual(bar.x, 2)
        self.assertAlmostEqual(bar.y, 5.0)

#
#
# 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:test_multiprocessing.py

示例3: setUp

# 需要导入模块: from multiprocessing import sharedctypes [as 别名]
# 或者: from multiprocessing.sharedctypes import copy [as 别名]
def setUp(self):
        self.registry_backup = util._finalizer_registry.copy()
        util._finalizer_registry.clear() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:5,代码来源:test_multiprocessing.py

示例4: test_dict

# 需要导入模块: from multiprocessing import sharedctypes [as 别名]
# 或者: from multiprocessing.sharedctypes import copy [as 别名]
def test_dict(self):
        d = self.dict()
        indices = list(range(65, 70))
        for i in indices:
            d[i] = chr(i)
        self.assertEqual(d.copy(), dict((i, chr(i)) for i in indices))
        self.assertEqual(sorted(d.keys()), indices)
        self.assertEqual(sorted(d.values()), [chr(i) for i in indices])
        self.assertEqual(sorted(d.items()), [(i, chr(i)) for i in indices]) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:11,代码来源:_test_multiprocessing.py


注:本文中的multiprocessing.sharedctypes.copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。