Re: why not bisect options?

2008-03-04 Thread Robert Bossy
Aaron Watters wrote: > On Feb 29, 9:31 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > >> Hi all, >> >> I thought it would be useful if insort and consorts* could accept the >> same options than list.sort, especially key and cmp. >> > > Wouldn't this make them slower and less space effici

Re: why not bisect options?

2008-03-04 Thread Aaron Watters
On Feb 29, 9:31 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi all, > > I thought it would be useful if insort and consorts* could accept the > same options than list.sort, especially key and cmp. Wouldn't this make them slower and less space efficient? It would be fine to add something lik

Re: why not bisect options?

2008-03-04 Thread rbossy
Quoting Raymond Hettinger <[EMAIL PROTECTED]>: > [Robert Bossy] > > I thought it would be useful if insort and consorts* could accept the > > same options than list.sort, especially key and cmp. > > If you're going to do many insertions or searches, wouldn't it be > *much* more efficient to store

Re: why not bisect options?

2008-03-01 Thread Paul Rubin
Raymond Hettinger <[EMAIL PROTECTED]> writes: > The sort() function guarantees that it calls the key function exactly > once for each member of the list. That is a time-space tradeoff though, and it presupposes that it's possible to write a key function. Depending on the objects involved, it cou

Re: why not bisect options?

2008-03-01 Thread rbossy
Selon Raymond Hettinger <[EMAIL PROTECTED]>: > [Robert Bossy] > > I thought it would be useful if insort and consorts* could accept the > > same options than list.sort, especially key and cmp. > > If you're going to do many insertions or searches, wouldn't it be > *much* more efficient to store yo

Re: why not bisect options?

2008-02-29 Thread castironpi
On Feb 29, 1:15 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Robert Bossy] > > > I thought it would be useful if insort and consorts* could accept the > > same options than list.sort, especially key and cmp. > > If you're going to do many insertions or searches, wouldn't it be > *much* more

Re: why not bisect options?

2008-02-29 Thread Raymond Hettinger
[Robert Bossy] > I thought it would be useful if insort and consorts* could accept the > same options than list.sort, especially key and cmp. If you're going to do many insertions or searches, wouldn't it be *much* more efficient to store your keys in a separate array? The sort() function guarant

why not bisect options?

2008-02-29 Thread Robert Bossy
Hi all, I thought it would be useful if insort and consorts* could accept the same options than list.sort, especially key and cmp. The only catch I can think of is that nothing prevents a crazy developer to insort elements using different options to the same list. I foresee two courses of acti