Hash of class from instance

Joakim Storck joakim.storck at home.se
Wed Feb 2 12:01:22 EST 2005


Hello,

Is there any way that I can find the hash value of a class from an
instance?

>>> class A:
... 	pass
...
>>> a = A()
>>> hash(A)
10782976
>>> hash(a)
12251904
>>>

What I want is a function that returns the value of 'hash(A)':
> a.getHashOfClass()
10782976

Is this possible?

/Joakim




More information about the Python-list mailing list