Making the case for "typed" lists/iterators in python

Chris Angelico rosuav at gmail.com
Fri Dec 16 13:43:17 EST 2011


On Sat, Dec 17, 2011 at 5:38 AM, Arnaud Delobelle <arnodel at gmail.com> wrote:
> On 16 December 2011 18:25, Chris Angelico <rosuav at gmail.com> wrote:
>
>> tee = lambda func,arg: (func(arg),arg)[1]
>
> What a strange way to spell it!
>
> def tee(func, arg):
>    func(arg)
>    return arg

I started with that version and moved to the lambda for compactness.
But either way works.

It's no more strange than the way some people omit the u from colour. :)

ChrisA



More information about the Python-list mailing list