[DB-SIG] Cursor.description when Cursor.rowcount == 0
Art Protin
aprotin at research.att.com
Fri Nov 10 17:35:09 CET 2006
Dear folks,
On testing and documenting my implementation of the V2 DB API Spec,
I am bothered
by my (limited) understanding of what the spec says for the behavior of
Cursor.description .
Clearly when a query (or rather an SQL statement) does not produce a
result, .description should be None. However, not producing a result is
not the same as producing a table of
zero rows by one or more columns. (This is like the distinction between
the two comparisons
"" == False
and
"" is False
, the empty string has the same 'value' as False while remaining distinct.)
I do not know that this will ever make a difference to my users
but I am expected
to be precise in my implementation. Is it the general understanding
that .description
will return None whenever the result set has no rows?
Thank you all,
Arthur Protin
More information about the DB-SIG
mailing list