[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: objects as mutable dictionary keys
From: Peter Maas <peter () somewhere ! com>
Date: 2004-12-28 9:42:11
Message-ID: 33co6sF3viiguU1 () individual ! net
[Download RAW message or body]
John Roth schrieb:
> No. The basic answer is that it's up to the object whether
> it will allow itself to be used as a dictionary key. In other
> words, if the designer of an object thinks it makes sense
> for instances to be dictionary keys, then he can supply a
> __hash__() method. If he doesn't, then he doesn't supply
> such a method, and it won't work.
Except for classic objects which can be used as dictionary
keys without having __hash__().
--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic