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
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
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
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
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
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
[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
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