---
title: "Comment by HEE JAE CHOI on \"7 Different Ways to Flatten a List of Lists in Python\" | Hashnode"
description: "Great article!! By the way, is it typo? def flatten_recursive ( lst: List[Any] ) -&gt; Iterable[Any]: &quot;&quot;&quot;Flatten a list using recursion.&quot;&qu"
url: "https://hashnode.com/posts/python-flatten-list/5fd49556b6e5766805757aa7/comment/5fd633f5f60e3973bae6c4d0"
---

[Discussion](https://hashnode.com/posts/python-flatten-list/5fd49556b6e5766805757aa7)

Comment [7 Different Ways to Flatten a List of Lists in Python](https://hashnode.com/posts/python-flatten-list/5fd49556b6e5766805757aa7)

[HEE JAE CHOI](https://hashnode.com/@gmlwo530)

[Dec 13, 2020](https://hashnode.com/posts/python-flatten-list/5fd49556b6e5766805757aa7/comment/5fd633f5f60e3973bae6c4d0)

Great article!!

By the way, is it typo?

```
def flatten_recursive(lst: List[Any]) -> Iterable[Any]:
    """Flatten a list using recursion."""
    for item in lst:
        if isinstance(item, list):
            yield from flatten(item)  # This line! I think it will be `yield from flatten_recursive(item)`
        else:
            yield item
```

[Miguel Brito](https://hashnode.com/@miguendes)

[Dec 13, 2020](https://hashnode.com/posts/python-flatten-list/5fd49556b6e5766805757aa7/comment/5fd633f5f60e3973bae6c4d0#reply-5fd6651627af257395892223)

Thanks [HEE JAE CHOI](https://hashnode.com/@gmlwo530), and yes, this is a typo!

Thanks for flagging it, I've just fixed it. I renamed it before publishing to make it easier to understand and forgot to double check it in IPython.

This is the correct version:

```
def flatten_recursive(lst: List[Any]) -> Iterable[Any]:
    """Flatten a list using recursion."""
    for item in lst:
        if isinstance(item, list):
            yield from flatten_recursive(item)
        else:
            yield item
```
