[DB-SIG] Remaining issues with DB API 1.1

Mark Hammond MHammond@skippinet.com.au
Sun, 28 Mar 1999 11:54:59 +1000


>          available. The number of rows to fetch is specified by
the
>          parameter. If it is None, then the cursor's
> arraysize determines
>          the number of rows to be fetched.
>
> That last part is bogus, IMHO. Also, the spec does not state
how
> many rows to fetch if size is completely omitted. How about
specifying
> size as optional argument that defaults to cursor.arraysize ?!
...

I think the spec is fine - maybe just needs to be changed to "if
it is None or not specified ...".

Then again, explicitely stating the use of "None" makes it a PITA
for implementations in C - it pretty much means you can't use
PyArg_ParseTuple(args, "|i", &size);

So to remove some burden on the implementors, it could be stated
simply as "If it is not specified, then the cursor's arraysize
determines          the number of rows to be fetched.".  This
leaves implementors using C to use PyArg_ParseTuple, but
implementors in Python to use "def xx(size = None):" - they are
keeping to the spec, but users are not free to make an assumption
about what the default is - they know the behaviour, not the
implementation.

No need to specify in the spec exactly _what_ the default should
be - it seems sufficient to describe the behaviour - ie, "if not
specified", rather than "the default value is xxx"

> I've updated the spec according the above lines (which, of
course,
> doesn't mean you can't object ;-) :

OK :-)  Not a serious objection, tho - just 2c worth.

[Hey - finally I have something to say here :-]

Mark.