Fast attribute/list item extraction

Raymond Hettinger vze4rx4y at verizon.net
Wed Dec 3 17:43:05 EST 2003


[Bengt Richter]
> >> > Please can we have a name that better expresses the functionality?
> >> >
> >> > E.g., 'keyfunc', or 'xform' or something that says the method is
expecting
> >> > a function that will be called with the sorting argument to produce the
> >value
> >> > used in sorting? "key=" doesn't do it IMO.

[Raymond]
> >cmpfunc= and keyfunc= were both suggested by several non-Dutch such as
myself.
> >
> >Then, Guido rightly pointed out that the keywords should just be pithy memory
> >joggers. Taken in that light, key= and cmp= do the job nicely.

[Bengt Richter]
> Excuses, rationalizations. I don't wan't to incite a contest, but IMO "key="
is misleading ;-)

Since these keywords may take root and sprout-up in several places, now is the
time to take action and send your suggestion to either python-dev or to the
BDFL.

At first, I also didn't like the short forms, but now they feel right as rain -- 
meaning that I now think it was the right way to go.

signature(as_long_hyphenated="good luck on the crusade")-ly yours,


Raymond Hettinger

Raymond







More information about the Python-list mailing list