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

Steven D'Aprano steve at pearwood.info
Thu Jun 28 19:59:28 EDT 2018


Can I make a plea for people to not post code with source highlighting 
as HTML please? It is rendered like this for some of us:

On Thu, Jun 28, 2018 at 10:01:00AM -0700, Chris Barker via Python-ideas wrote:

    In [*46*]: {a:[t[0] *for* t *in* b] *for* a,b *in*
    groupby(sorted(student_school_list,
    key=*lambda* t: t[1]), key=*lambda* t: t[
    ...

(Aside from the iPython prompt, the rest ought to be legal Python but 
isn't because of the extra asterisks added.)

And in the archives:

https://mail.python.org/pipermail/python-ideas/2018-June/051723.html

Gmail, I believe, has a "Paste As Plain Text" command in the 
right-click menu. Or possibly find a way to copy the text without 
formatting in the first case. 


Thanks,


-- 
Steve


More information about the Python-ideas mailing list