In the example I gave:

sorted_list = sorted(list_strings, key = str.lower)

sorted takes str.lower as a parameter, doesn't it? So, it should be a high
order function

El 14 de febrero de 2011 21:06, Walter Prins <wpr...@gmail.com> escribió:

>
>
> 2011/2/14 Rafael Durán Castañeda <rafadurancastan...@gmail.com>
>
> Could we consider sorted as an high order function?
>>
>> sorted_list = sorted(list_strings, key = str.lower)
>>
>>
> No because sorted() returns a list as a result.   A higher order function
> produces another function as a result, or takes one or more functions as a
> parameter.
>
> Walter
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to