Пример #1
0
 def test_compact(self):
     self.assertEqual([True, 1, 0.1, "non-empty", [""], (0, ), {
         "a": 1
     }],
                      list(
                          iters.compact([
                              None, False, True, 0, 1, 0.0, 0.1, "",
                              "non-empty", [], [""], (), (0, ), {}, {
                                  "a": 1
                              }
                          ])))
Пример #2
0
 def test_compact(self):
     self.assertEqual([True, 1, 0.1, "non-empty", [""], (0,), {"a": 1}],
                      list(iters.compact([None, False, True, 0, 1, 0.0, 0.1,
                                          "", "non-empty", [], [""],
                                          (), (0,), {}, {"a": 1}])))