dict's as dict's key.

Lie Ryan lie.1296 at gmail.com
Sun Jan 17 12:26:55 EST 2010


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
> 
> Which is great until you want to make a move.  ;)

No problem, just create a new namedtuple.

The OP wanted fast attribute lookup and AFAICT doesn't mention anything
about fast construction.



More information about the Python-list mailing list