From: <no...@so...> - 2002-11-06 17:12:09
|
Bugs item #634542, was opened at 2002-11-06 18:12 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=634542&group_id=16528 Category: PgResult Group: None Status: Open Resolution: None Priority: 5 Submitted By: Petter Reinholdtsen (pere) Assigned to: Nobody/Anonymous (nobody) Summary: SQL integer is not hashable Initial Comment: I'm unable to use a numeric value as the key in a dictioary. This is the error message: Traceback (most recent call last): File "Cerebrum/tests/SQLDriverTestCase.py", line 30, in testSQLIntHashable hash[value] = 1 TypeError: unhashable instance This is a fragment of the test code that fails: self.db.execute("CREATE TABLE test_db_dict (value NUMERIC(6,0))") self.db.execute("INSERT INTO test_db_dict (value) VALUES (1)") value = self.db.query_1("SELECT max(value) FROM test_db_dict") hash = {} hash[value] = 1 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=634542&group_id=16528 |