On Sun, May 25, 2008 at 3:10 AM, <[EMAIL PROTECTED]> wrote:

>
> > >>> l=list(s)
> > >>> l.sort()
> > >>> l
> >
> > ['a', 'b', 'c']
> >
> > hth,
> > Rares
>
> sets dont seem to be so good because there is no way to iterate them.
>
> s.pop()                 remove and return an arbitrary element from s;
> raises
> KeyError if empty
>
> i dont want to remove i just want to get the string that is stored
> there.


The only requirement for iterating through something is that it defines an
__iter__ method, which set does. This means you can use iter(a_set) to get
your iterator, or just use "for i in a_set" to iterate automatically.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to