dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.

Home Page:http://pydash.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flatten should support generators / querysets

stevelacey opened this issue · comments

Flatten in fnc will flatten a list of querysets but pydash won't:

from fnc import flatten

list(flatten([Skill.objects.all()[:2], Skill.objects.all()[2:4]]))
[<Skill: .NET Framework>, <Skill: 3D>, <Skill: 3D CAD>, <Skill: 3D Printing>]

from pydash import flatten

list(flatten([Skill.objects.all()[:2], Skill.objects.all()[2:4]]))
[<SkillQuerySet [<Skill: .NET Framework>, <Skill: 3D>]>,
 <SkillQuerySet [<Skill: 3D CAD>, <Skill: 3D Printing>]>]