Merging lists has made my brain hurt.

djw dwelch at nospam.vcd.hp.com
Wed Oct 2 12:40:27 EDT 2002


Alex wrote:
<snip>
> 
> The intersection of two "sets" (Sets per se are only added in Python
> 2.3, but you can use either lists OR dictionaries in Python 2.2 as
> sets -- all you need is iterability and ability to use 'in' to test
> membership) is pretty easy:
> 
<snip>

I needed to do this in a program in 2.2.1, so I went and grabbed a copy 
of set.py from the "Sandbox" in CVS. Works like a charm. Here is the link:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondist/sandbox/sets/


Don




More information about the Python-list mailing list