本文整理汇总了Python中dictset.DictSet.discard方法的典型用法代码示例。如果您正苦于以下问题:Python DictSet.discard方法的具体用法?Python DictSet.discard怎么用?Python DictSet.discard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dictset.DictSet
的用法示例。
在下文中一共展示了DictSet.discard方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test6
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test6(self):
L = DictSet(s2d('a123 b456'))
R = s2l('b456')
L.discard('a')
self.assertEqual(d2l(L),R)
示例2: test7
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test7(self):
L = DictSet(s2d('a123 b456'))
L.discard('a')
L.discard('a') # Shouldn't complain
示例3: test5
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test5(self):
L = DictSet(s2d('a0'))
R = s2l('')
L.discard('a')
self.assertEqual(d2l(L),R)
示例4: test4
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test4(self):
L = DictSet(s2d('a1 c5666788'))
R = s2l('a1 c56 7')
L.discard('c','8')
L.discard([],'8') # shouldn't complain
示例5: test3
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test3(self):
L = DictSet(s2d('a1 c5666788'))
R = s2l('a1 c56 7')
L.discard([],'8') # dosen't raise TypeError
示例6: test2
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test2(self):
L = DictSet(s2d('a1c5666788'))
R = s2l('a1c56 7')
L.discard('d','8') # doesn't raise KeyError
示例7: test01
# 需要导入模块: from dictset import DictSet [as 别名]
# 或者: from dictset.DictSet import discard [as 别名]
def test01(self):
L = DictSet(s2d('a1 c5666788'))
R = s2l('a1')
L.discard('c')
self.assertEqual(d2l(L),R)