Re: dict's as dict's key.

2010-01-17 Thread Lie Ryan
On 01/17/10 12:29, Ethan Furman wrote: > Lie Ryan wrote: >> On 01/14/10 05:33, Albert van der Horst wrote: >> >>> (I encountered this before. A dictionary is a natural for a >>> boardgame position, i.e. chess. Now we want to look up chess >>> positions.) >> >> >> or use collections.namedtuple > >

Re: dict's as dict's key.

2010-01-16 Thread Ethan Furman
Lie Ryan wrote: On 01/14/10 05:33, Albert van der Horst wrote: (I encountered this before. A dictionary is a natural for a boardgame position, i.e. chess. Now we want to look up chess positions.) or use collections.namedtuple Which is great until you want to make a move. ;) ~Ethan~ -- ht

Re: dict's as dict's key.

2010-01-15 Thread Lie Ryan
On 01/14/10 05:33, Albert van der Horst wrote: > (I encountered this before. A dictionary is a natural for a > boardgame position, i.e. chess. Now we want to look up chess > positions.) or use collections.namedtuple -- http://mail.python.org/mailman/listinfo/python-list

Re: dict's as dict's key.

2010-01-13 Thread Peter Otten
Albert van der Horst wrote: > I have a type of objects that have complicated enough properties > to warrant a special class for its type. > The class has built in dictionary for all the properties. > > Something along the line of > a = ctype({"poker":True}) > b = ctype({"footbal":True, "gender":"

Re: dict's as dict's key.

2010-01-13 Thread Arnaud Delobelle
Albert van der Horst writes: > I have a type of objects that have complicated enough properties > to warrant a special class for its type. > The class has built in dictionary for all the properties. > > Something along the line of > a = ctype({"poker":True}) > b = ctype({"footbal":True, "gender":

dict's as dict's key.

2010-01-13 Thread Albert van der Horst
I have a type of objects that have complicated enough properties to warrant a special class for its type. The class has built in dictionary for all the properties. Something along the line of a = ctype({"poker":True}) b = ctype({"footbal":True, "gender":"m"}) c = ctype({"chess":True, "residence":"