[issue20632] Define a new __key__ protocol
Nick Coghlan
report at bugs.python.org
Sat Feb 22 15:14:43 CET 2014
Nick Coghlan added the comment:
I suspect it could just be a class decorator (along the lines of
total_ordering), and it should certainly be prototyped on PyPI as such a
decorator (using a different name for the key calculating method). If it
eventually happened, elevation to a core protocol would really be about
defining this as being *preferred* in the cases where it applies, and
that's a fairly weak basis for changing the type constructor.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20632>
_______________________________________
More information about the Python-bugs-list
mailing list