In <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:

> Since any element of the set serves as a name (and you know the sets are
> all non- empty), it'd be very nice to have a .element() method, or some
> such. I guess "iter(s).next()" works okay, but it's not very readable,
> and I wonder if it's efficient.

Give it a name and it gets more readable:

def get_name(setobj):
    return iter(setobj).next()

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to