[Python-ideas] Allow a group by operation for dict comprehension

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Jun 28 19:23:52 EDT 2018


Nicolas Rolin wrote:
>     student_by_school = {group_by(school): student for school, student 
> in student_school_list}

In the spirit of making the target expression look like
a template for the generated elements,

    {school: [student...] for school, student in student_school_list}

-- 
Greg


More information about the Python-ideas mailing list