*-unpacking (Re: Fun with fancy slicing)

Alex Martelli aleax at aleax.it
Fri Oct 3 06:18:38 EDT 2003


David Eppstein wrote:

>> In the mean time, it isn't too hard to write a function which does this:
>> 
>>      def first_rest(x):
>>          return x[0], x[1:]
> 
> Shouldn't that be called cons?

Hmmm, feels more like the 'reverse' of a cons to me -- takes a list
and gives me the car and cdr...


Alex





More information about the Python-list mailing list