On Jun 8, 12:17 am, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]>
wrote:
> Terry Reedy wrote:
> > "Dan Bishop" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> >> If you don't need the list to be sorted until you're done building
> >> it, you can just use:
>
> >> lst = sorted(set(lst
Terry Reedy wrote:
> "Dan Bishop" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> If you don't need the list to be sorted until you're done building
>> it, you can just use:
>>
>> lst = sorted(set(lst))
>
> ?? looks same as
> lst.sort()
You missed that the OP wants only unique
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| If you don't need the list to be sorted until you're done building it,
| you can just use:
|
| lst = sorted(set(lst))
?? looks same as
lst.sort()
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 6, 10:26 am, rhXX <[EMAIL PROTECTED]> wrote:
> hi,
>
> can i append a item to a list using criterias:
>
> - UNIQUE - if there already exist don't append
>
> and/or
>
> - SORTED - INSERT in the correct place using some criteria?
>
> tks in advance
If you don't need the list to be sorted unti
--- Neil Cerutti <[EMAIL PROTECTED]> wrote:
> i agree that using bisect and inserting manually
> clearly meets
> the stated requirements, while there isn't enough
> information to
> know if a heapq will meet his requirements.
>
> Thanks for the correction.
>
If the OP is still reading, don't di
On 2007-06-06, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote:
>>> and/or
>>>
>>> - SORTED - INSERT in the correct place using some criteria?
>>
>> Consult the Python Docs about the heapq module.
>
> Heaps (as produced by heapq) are
On Jun 6, 6:35 pm, Josiah Carlson <[EMAIL PROTECTED]>
wrote:
ok, tks to all for ur help and comments!!!
> Neil Cerutti wrote:
> > On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote:
> >> and/or
>
> >> - SORTED - INSERT in the correct place using some criteria?
>
> > Consult the Python Docs about the he
Neil Cerutti wrote:
> On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote:
>> and/or
>>
>> - SORTED - INSERT in the correct place using some criteria?
>
> Consult the Python Docs about the heapq module.
Heaps (as produced by heapq) are not sorted. This will not produce
correct results unless one then
On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote:
> hi,
>
> can i append a item to a list using criterias:
>
> - UNIQUE - if there already exist don't append
Consult the Python Docs about sets.
> and/or
>
> - SORTED - INSERT in the correct place using some criteria?
Consult the Python Docs about th
rhXX wrote:
> hi,
>
> can i append a item to a list using criterias:
>
> - UNIQUE - if there already exist don't append
> - SORTED - INSERT in the correct place using some criteria?
Both can be accomplished using the bisect-module. It will give you the
leftmost/rightmost insertion point for
hi,
can i append a item to a list using criterias:
- UNIQUE - if there already exist don't append
and/or
- SORTED - INSERT in the correct place using some criteria?
tks in advance
--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo