On Mon, Dec 04, 2017 at 08:45:55AM +0200, Serhiy Storchaka wrote:

> But the idea of the class decorator looks more sane to me.

The purpose of __key__ is to define a key function (not a comparison 
operator) for classes that aren't orderable and don't have __lt__.

If you're going to then go ahead and define __lt__ and the other 
comparison operators, there's no point to __key__.



-- 
Steve
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to