On Sep 29, 11:37 am, [EMAIL PROTECTED] wrote: > George Sakkis: > > > No difference in principle, just len() happens to be implemented more > > often than upper(). > > That's an important point. In a language that tries to be both > practical, readable, and elegant, the things that are done more may > deserve some sugar, to avoid code like this in many cases: > > sorted(seq, key=lambda x:x.__len__())
If this was the most compelling use case of having len as builtin, I would be even less convinced. How often do you sort by len? FWIW, the most common sorting keys I see in real world are attrgetter(some_attr) or itemgetter(some_index) and both are imported functions, not builtins. George -- http://mail.python.org/mailman/listinfo/python-list