On 13Dec2011 00:30, Eelco <hoogendoorn.ee...@gmail.com> wrote: | On Dec 13, 1:27 am, alex23 <wuwe...@gmail.com> wrote: | > On Dec 13, 3:12 am, Eelco <hoogendoorn.ee...@gmail.com> wrote: | > > But to relate it to the topic of this thread: no, the syntax does not | > > allow one to select the type of the resulting sequence. It always | > > constructs a list. | > | > So by this argument, _every_ function that returns a list should take | > an optional argument to specify an alternative form of sequence. | > | > What, exactly, is so onerous about coercing your list to _whatever_ | > type you want? You know, like everybody else has been. | > | > What does this _gain_ you other than one less line of code? | | 1) Turning two lines of code into a single more readable one is | nothing to scoff at | 2) After-the-fact conversion is O(n), getting the view you want right | away is O(1)
Regarding (2), it has already cost you O(n) to get there. So your O(1) is a little ingenuous. -- Cameron Simpson <c...@zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ I'm a volunteer EMT-I on our local ambulance service; one of our Paramedics calls squid style motorcycle accidents "ZoomSplats", as in "we had a good ZoomSplat the other night". ;-) - Scott <trau...@rapnet.sanders.lockheed.com> -- http://mail.python.org/mailman/listinfo/python-list