def test_flatten(self):

        self.assertEqual(
            list(flatten(2, 3, "a", [2, 3, str, [5, [10, 89]]])),
            [2, 3, "a", 2, 3, str, 5, 10, 89],
        )
Esempio n. 2
0
 def validate_types(self, types):
     for t in frozenset(flatten(types)):
         if not inspect.isclass(t):
             raise ValueError('%s is not a class' % t)
         yield t