Example #1
0
 def test_empty(self):
     target_dict = frozendict()
     self.assertEquals(0, len(target_dict))
     self.assertEquals(0, IterTools.quantify(target_dict.iteritems(), lambda x: 1))
Example #2
0
 def test_quantify_4(self):
     self.assertEquals(14, IterTools.quantify(range(15)))
Example #3
0
 def test_quantify_2(self):
     self.assertEquals(0, IterTools.quantify([0]))
Example #4
0
 def test_quantify_3(self):
     self.assertEquals(1, IterTools.quantify(iter([1])))
 def uppercount(in_str):
     return 0 - IterTools.quantify(imap(lambda ch: ch.isupper(), in_str))