def test_simple_iterable_types(self):
        """Test all simple iterables that a List can be constructed from."""

        def generate_function(line):
            context = {}
            code = dedent("""
                from numba.typed import List
                def bar():
                    {}
                    return l
                """).format(line)
            exec(code, context)
            return njit(context["bar"])
        for line in ("l = List([0, 1, 2])",
                     "l = List(range(3))",
                     "l = List(List([0, 1, 2]))",
                     "l = List((0, 1, 2))",
                     "l = List(set([0, 1, 2]))",
                     ):
            foo = generate_function(line)
            cf_received, py_received = foo(), foo.py_func()
            for result in (cf_received, py_received):
                for i in range(3):
                    self.assertEqual(i, result[i])
Test all simple iterables that a List can be constructed from.
numba/tests/test_typedlist.py