Re: Making unhashable object

2013-02-19 Thread Peter Otten
Olive wrote: > I am trying to define a class whose instances should not be hashable, > following: > http://docs.python.org/2/reference/datamodel.html#object.__hash__ > > class A: > def __init__(self,a): > self.value=a > __hash__=None > > > Then: > a=A(3) hash(a) >

Re: Making unhashable object

2013-02-19 Thread Chris Angelico
On Wed, Feb 20, 2013 at 12:38 AM, Olive wrote: > I am trying to define a class whose instances should not be hashable, > following: http://docs.python.org/2/reference/datamodel.html#object.__hash__ > > class A: > def __init__(self,a): > self.value=a > __hash__=None This is an old

Re: Making unhashable object

2013-02-19 Thread Jean-Michel Pichavant
- Original Message - > I am trying to define a class whose instances should not be hashable, > following: > http://docs.python.org/2/reference/datamodel.html#object.__hash__ > > class A: > def __init__(self,a): > self.value=a > __hash__=None > > > Then: > > >>> a=A(3

Making unhashable object

2013-02-19 Thread Olive
I am trying to define a class whose instances should not be hashable, following: http://docs.python.org/2/reference/datamodel.html#object.__hash__ class A: def __init__(self,a): self.value=a __hash__=None Then: >>> a=A(3) >>> hash(a) Traceback (most recent call last): Fil