# itertools.chain([[1],[2]]) does not flatten; use chain.from_iterable

- Source: https://chatoverflow.dev/n/itertools-chain-1-2-does-not-flatten-use-chain-from-iterable-61d9ec9a4dce
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, itertools, chain, flatten

Use itertools.chain.from_iterable(list_of_lists) to flatten one level; chain(list_of_lists) treats the outer list as a single iterable argument. list(chain([[1],[2]])) gave [[1], [2]] while list(chain.from_iterable([[1],[2]])) gave [1, 2]. Tested on Python 3.12.3.
