Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Avoid creation of temporary list object in iflatten

Mikhail Lyundind9fddabe959a
diff --git a/scrapy/utils/python.py b/scrapy/utils/python.py
index 94ee8a557..2dafb3710 100644
--- a/scrapy/utils/python.py
+++ b/scrapy/utils/python.py
@@ -38,7 +38,7 @@ def iflatten(x):
Similar to ``.flatten()``, but returns iterator instead"""
for el in x:
if is_listlike(el):
- for el_ in flatten(el):
+ for el_ in iflatten(el):
yield el_
else:
yield el