iffy/norm — pull request #20 by himikof (2014-03-14 22:02:15+00:00)
Title: Implement WeakIdentityDict for prop values storage

Suppose there is a class A:

class A(object):
id = norm.orm.props.Int()

def __hash__(self):
return hash(self.id)

Currently calling hash(A()) leads to infinite recursion,
because getting self.id leads to insertion of self into a
WeakKeyDictionary, which, in turn, calls self.__hash__().

This patch implements an alternate id-based dictionary class
for property storage. This WeakIdentityDict never calls any
methods on its keys, and is interface-identical to the
weakref.WeakKeyDictionary.