本文整理匯總了Python中Bio.Pathway.Rep.HashSet.contains方法的典型用法代碼示例。如果您正苦於以下問題:Python HashSet.contains方法的具體用法?Python HashSet.contains怎麽用?Python HashSet.contains使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bio.Pathway.Rep.HashSet
的用法示例。
在下文中一共展示了HashSet.contains方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testContains
# 需要導入模塊: from Bio.Pathway.Rep import HashSet [as 別名]
# 或者: from Bio.Pathway.Rep.HashSet import contains [as 別名]
def testContains(self):
n = HashSet()
self.assertTrue('a' not in n, "element in empty set")
self.assertTrue(not n.contains('a'), "element in empty set (2)")
a = HashSet(['a','b','c','d'])
self.assertTrue('a' in a, "contained element not found")
self.assertTrue('d' in a, "contained element not found")
self.assertTrue('e' not in a, "not contained element found")
self.assertTrue(68 not in a, "not contained element found")
self.assertTrue(a.contains('a'), "contained element not found (2)")
self.assertTrue(a.contains('d'), "contained element not found (2)")
self.assertTrue(not a.contains('e'), "not contained element found (2)")
self.assertTrue(not a.contains(68), "not contained element found (2)")