本文整理汇总了Python中copy_reg._slotnames方法的典型用法代码示例。如果您正苦于以下问题:Python copy_reg._slotnames方法的具体用法?Python copy_reg._slotnames怎么用?Python copy_reg._slotnames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类copy_reg
的用法示例。
在下文中一共展示了copy_reg._slotnames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_slotnames
# 需要导入模块: import copy_reg [as 别名]
# 或者: from copy_reg import _slotnames [as 别名]
def test_slotnames(self):
self.assertEqual(copy_reg._slotnames(WithoutSlots), [])
self.assertEqual(copy_reg._slotnames(WithWeakref), [])
expected = ['_WithPrivate__spam']
self.assertEqual(copy_reg._slotnames(WithPrivate), expected)
expected = ['_WithLeadingUnderscoreAndPrivate__spam']
self.assertEqual(copy_reg._slotnames(_WithLeadingUnderscoreAndPrivate),
expected)
self.assertEqual(copy_reg._slotnames(___), ['__spam'])
self.assertEqual(copy_reg._slotnames(WithSingleString), ['spam'])
expected = ['eggs', 'spam']
expected.sort()
result = copy_reg._slotnames(WithInherited)
result.sort()
self.assertEqual(result, expected)
示例2: test_slotnames
# 需要导入模块: import copy_reg [as 别名]
# 或者: from copy_reg import _slotnames [as 别名]
def test_slotnames(self):
self.assertEqual(copy_reg._slotnames(WithoutSlots), [])
self.assertEqual(copy_reg._slotnames(WithWeakref), [])
expected = ['_WithPrivate__spam']
self.assertEqual(copy_reg._slotnames(WithPrivate), expected)
self.assertEqual(copy_reg._slotnames(WithSingleString), ['spam'])
expected = ['eggs', 'spam']
expected.sort()
result = copy_reg._slotnames(WithInherited)
result.sort()
self.assertEqual(result, expected)
示例3: test_slotnames
# 需要导入模块: import copy_reg [as 别名]
# 或者: from copy_reg import _slotnames [as 别名]
def test_slotnames(self):
self.assertEquals(copy_reg._slotnames(WithoutSlots), [])
self.assertEquals(copy_reg._slotnames(WithWeakref), [])
expected = ['_WithPrivate__spam']
self.assertEquals(copy_reg._slotnames(WithPrivate), expected)
self.assertEquals(copy_reg._slotnames(WithSingleString), ['spam'])
expected = ['eggs', 'spam']
expected.sort()
result = copy_reg._slotnames(WithInherited)
result.sort()
self.assertEquals(result, expected)