pydash icon indicating copy to clipboard operation
pydash copied to clipboard

Flatten should support generators / querysets

Open stevelacey opened this issue 2 years ago • 0 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>]>]

stevelacey avatar Apr 05 '22 06:04 stevelacey