From: Harri P. <har...@tr...> - 2002-04-25 07:36:13
|
Hi, By the looks of it, NumericType is not python hash table friendly. That means that something like: c.execute('select id, limit_id, name from Sublimit_cvt') rows = c.fetchall() for row in rows: id, limit_id, name = row c.execute('select id from MyTable') rows = c.fetchall() for row in rows: id = row[0] print map[id] will fail if id is of type AutomaticID in Sybase. I'm not sure if this is required by DB API, but I think it violates the principle of least surprise. My workaround was to force a conversion to string, so my code now reads map[str(id)]. But maybe NumericType should be modified to act as any number when used as a hash key? Any opinions? -Harri |