[Python-ideas] a sorting protocol dunder method?

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Dec 4 23:36:12 EST 2017


> On 12/04/2017 10:01 AM, brent bejot wrote:
> 
>> I think we can all agree that defining
>> __key__ and calling "sorted(list_of_attrdicts)" has that syntactic 
>> sugar that is oh-so-sweet-and-tasty.

Just remember that too much syntactic sugar can give
you cancer of the semicolon.

-- 
Greg



More information about the Python-ideas mailing list