On Apr 23, 2:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > "Jared Grubb" <[EMAIL PROTECTED]> wrote in message > >news:[EMAIL PROTECTED] > > | I want a function that removes values from a list if a predicate > > evaluates > > | to True. > > > Forget the rigamarole you posted, which has several defects. > > If you must modify the list in place, because you have multiple references > > to it: > > > lst[:] = filter(lambda x: not pred(x), lst) > > Wouldn't > > lst[:] = [x for x in lst if not pred(x)] > > be more direct? > > > Otherwise, just lst = filter(....) > > And similarly > > lst = [x for x in lst if not pred(x)] > > regards > Steve > -- > Steve Holden +1 571 484 6266 +1 800 494 3119 > Holden Web LLC http://www.holdenweb.com/
And, actually, if you aren't using the GIL, immutables historically come with locks, which carries concerns with reality (spatialty +localty), i.e. money, if your technique gains from computer speed, but there's a right one for a market nitch. It could be that computers are doing all they can for everybody's public's good, so if so, every alternative will be profitable recreationally only. No reason you can't write a mutable structure that supports multiple references and keep it off the hard drive, but without defining Clear( time0, b ) + Set( time0, b ), you can't beat macrolocks without micros. And of course, neither RAM nor magnetics offer stereo (two-dimensional +) seek mechanisms today. But we'll be allocating squares of memory eventually. All technologies are inevitable. -- http://mail.python.org/mailman/listinfo/python-list