etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 129 forks source link

Refactor search list comprehension #286

Closed pickfire closed 2 years ago

etianen commented 2 years ago

What is the purpose of this refactor?

pickfire commented 2 years ago

[...] is more readable and common than list(chain.from_iterable(...)).

etianen commented 2 years ago

Unfortunately, [...] is not equivalent to list(chain.from_iterable(...)). Previously, the code created a List[SearchEntry]. After your change, it creates a List[Iterable[SearchEntry]]. You'll see this in the failing test results.