'See http://bugs.python.org/issue7478
It was possible to successfully register callbacks that could not be
hashed. Return codes of PyDict_SetItem were not checked properly.'

def CheckSetDict(self):

    class NotHashable:
        def __call__(self, *args, **kw):
            pass
        def __hash__(self):
            raise TypeError()
    var = NotHashable()
    self.assertRaises(TypeError, self.con.create_function, var)
    self.assertRaises(TypeError, self.con.create_aggregate, var)
    self.assertRaises(TypeError, self.con.set_authorizer, var)
    self.assertRaises(TypeError, self.con.set_progress_handler, var)
