[EMAIL PROTECTED] wrote:
> In the particular case, I have to read an attribute from any one of
> the elements, which one doesn't matter because this attribute value is
> same across all elements in the set.

Someone else pointed out that there might be better data structures. If 
performance was not an issue one approach would be illustrated by the 
following:

 >>> Q=set(['A','a'])
 >>> list(set(x.upper() for x in Q))
['A']

This has the benefit that it does not assume all the elements of the set 
have the same value of the given attribute.

Again not very efficient:

 >>> list(Q)[0]
'A'

I'm guessing this would be quicker

 >>> iter(Q).next()
'A'
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to