Re: converting a set into a sorted list

2005-05-15 Thread Bengt Richter
On Sat, 14 May 2005 19:20:24 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >MackS wrote: >> Dear all, >> >> I've got several large sets in my program. After performing several >> operations on these I wish to present one set to the user [as a list] >> sorted according to a certain criterion. Is t

Re: converting a set into a sorted list

2005-05-14 Thread MackS
Thank you for the pointer. I'll upgrade to 2.4. Best, Mack -- http://mail.python.org/mailman/listinfo/python-list

Re: converting a set into a sorted list

2005-05-14 Thread Brian Beck
Robert Kern wrote: > MackS wrote: > >> Dear all, >> >> I've got several large sets in my program. After performing several >> operations on these I wish to present one set to the user [as a list] >> sorted according to a certain criterion. Is there any direct way to do >> so? Or must I >> >> list

Re: converting a set into a sorted list

2005-05-14 Thread Terry Reedy
"MackS" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Can I somehow avoid doing this in two stages? Can I somehow avoid first > creating a long list only to immediately sort it afterwards? Yes, you could interatively extract and append the min of the set (selection sort), but th

Re: converting a set into a sorted list

2005-05-14 Thread Robert Kern
MackS wrote: > Dear all, > > I've got several large sets in my program. After performing several > operations on these I wish to present one set to the user [as a list] > sorted according to a certain criterion. Is there any direct way to do > so? Or must I > > list = [] > > for item in set1: >

converting a set into a sorted list

2005-05-14 Thread MackS
Dear all, I've got several large sets in my program. After performing several operations on these I wish to present one set to the user [as a list] sorted according to a certain criterion. Is there any direct way to do so? Or must I list = [] for item in set1: list.append(item) list.sort(...