On Thu, Feb 26, 2009 at 8:49 PM, Benjamin Peterson <benja...@python.org> wrote:
> Shanmuga Rajan <m.shanmugarajan <at> gmail.com> writes:
>
>> f any one suggests better solution then i will be very happy.Advance thanks
> for any help.Shan
>
> Use a set.

To expand on that a bit:

counted_recs = set(rec[0] for rec in some_fun())
#or in Python 3.0:
counted_recs = {rec[0] for rec in some_fun()}

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to