Problem with psycopg2, bytea, and memoryview

dieter dieter at handshake.de
Thu Aug 1 02:05:37 EDT 2013


"Frank Millman" <frank at chagford.com> writes:

> ...
> At present, I loop over a range of columns, comparing 'before' and 'after' 
> values, without worrying about their types. Strings are returned as str, 
> integers are returned as int, etc. Now I will have to check the type of each 
> column before deciding whether to cast to 'bytes'.

Of course, you could implement your own "equality" function ("my_equal")
and replace "a == b" by "my_equal(a, b)".

In "my_equal", you could encapsulate whatever logic is necessary
for a reliable equality check.




More information about the Python-list mailing list