Need help...

Greg Ewing greg at cosc.canterbury.ac.nz
Mon May 6 23:01:23 EDT 2002


Shagshag wrote:
> 
> (a, b) -> v1 -> v2
> (a, c) -> v3 -> v5 -> v8
> (b, c) -> v1 -> v4
> (a, b, c) -> v2 -> v4 -> v7
> 
> and i must be able to retrieve (a, b) with (b, a), (a, c) with (c, a)
> and (a, b, c) with (a, c, b), (c, a, b), (b, a, c) or any combination
> of the three...

Create a sorted copy of the tuple and use that
as a dictionary key.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list