Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17376

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

References <mailman.3739.1324057724.27778.python-list@python.org> <roy-CE17C0.13053616122011@news.panix.com> <CAPTjJmoQJzHj0GiDv4G-MDHabssUQsCC4VT9anz2oikm6zHjUw@mail.gmail.com> <CAJ6cK1aUmgA=hbD=H_scx5rChnPowFHTp_AF9=6gk=OXQad9ug@mail.gmail.com>
Date 2011-12-17 05:43 +1100
Subject Re: Making the case for "typed" lists/iterators in python
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3747.1324061000.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Dec 17, 2011 at 5:38 AM, Arnaud Delobelle <arnodel@gmail.com> wrote:
> On 16 December 2011 18:25, Chris Angelico <rosuav@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Making the case for "typed" lists/iterators in python Nathan Rice <nathan.alexander.rice@gmail.com> - 2011-12-16 12:48 -0500
  Re: Making the case for "typed" lists/iterators in python Roy Smith <roy@panix.com> - 2011-12-16 13:05 -0500
    Re: Making the case for "typed" lists/iterators in python Chris Angelico <rosuav@gmail.com> - 2011-12-17 05:25 +1100
    Re: Making the case for "typed" lists/iterators in python Arnaud Delobelle <arnodel@gmail.com> - 2011-12-16 18:38 +0000
    Re: Making the case for "typed" lists/iterators in python Chris Angelico <rosuav@gmail.com> - 2011-12-17 05:43 +1100
      Re: Making the case for "typed" lists/iterators in python Mel Wilson <mwilson@the-wire.com> - 2011-12-16 15:14 -0500
    Re: Making the case for "typed" lists/iterators in python Ben Finney <ben+python@benfinney.id.au> - 2011-12-17 07:17 +1100
    Re: Making the case for "typed" lists/iterators in python Terry Reedy <tjreedy@udel.edu> - 2011-12-16 17:21 -0500
  Re: Making the case for "typed" lists/iterators in python Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-12-19 14:16 +0100
    Re: Making the case for "typed" lists/iterators in python Nathan Rice <nathan.alexander.rice@gmail.com> - 2011-12-19 10:56 -0500

csiph-web