Bob Ippolito wrote: > I don't see the harm in a "key" argument like sorted has, but without > a key argument it could be extended to take more arguments like max/ > min do for convenience. e.g. any(a, b, c) instead of any((a, b, c)).
Hmm, I think you just found the use case for fixing the current lack of support for keyword-only arguments - it allows conveniences like this, while still allowing keyword arguments to tailor function behaviour. For example, min & max could grow a "key" argument analogous to sorted's (e.g. to find the person with the highest score in a list of players). (Guido's already approved the concept of permitting keyword arguments to be supplied after a * entry in a function call. I don't remember if he expressed an opinion on allowing the same syntax in a function definition to define keyword only arguments). Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com