Author larry
Recipients larry, meador.inge
Date 2014-01-18.19:38:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Larry Hastings added the comment:

>  * As is probably expected, __init__ and __call__ procs
> can't be converted.

I should have a fix in for __init__ and __call__ later today.  (Issue #20294.)
For the record, you could convert them, you just had to wrap the parsing function
to deal with the return type difference, and *args / **kwargs might be tricky too.

>     * sqlite3.Connection.{execute, executemany, executescript} don't use
>       PyArg_Parse*.

In the next few days I'm going to add support for "*args" and "**kwargs", and
then you'll be able to convert these functions.  (Issue #20291.)  Again, even
if Argument Clinic doesn't do any parsing, it's still helpful to have it
generate signatures.

>     * The clinic version of 'sqlite3.adapt' has an argument string of "O|OO".
>       The first optional parameter defaults to 'pysqlite_PrepareProtocolType'
>       in C and 'sqlite3.ProtocolType' in Python.  However, I don't know how to
>       represent the Python value because Python default values are 'eval'd by
>       clinic *and* the 'sqlite3' module is not imported for the eval.

You'll be able to do this soon:

parameter: object(c_default='pysqlite_PrepareProtocolType') = ProtocolType

This feature isn't checked in yet, I'm waiting for a review.  It's part of
#20226, which I guess you already noticed.

>  * The clinic version of 'sqlite3.Cursor.fetchmany' has an arguments string
>    of "|i".  The first parameter defaults to
>    '((pysqlite_Cursor *)self)->arraysize' in C and 'self.arraysize' in
>    Python.  I don't know how to express the Python initialization.

You can't.  How about you use a default of -1 and then:

  if (maxrows == -1)
      maxrows = self->arraysize

>  * I didn't convert 'sqlite3.Cursor.setinputsizes' and
>    'sqlite3.Cursor.setoutputsize' because they share a docstring and
>    simple no-op method def.

I'd prefer it if you converted them anyway.  Converting them means they'll
have signature information which is an unconditional good.

>  * I didn't convert 'sqlite.connect' because it would have required
> packaing the arguments back up to pass to 'PyObject_Call'.

Once I add the ability to pass in *args and **kwargs, you'll be able to
convert sqlite.connect.  

I think I responded to all your other comments when I reviewed the patch.

Date User Action Args
2014-01-18 19:38:21larrysetrecipients: + larry, meador.inge
2014-01-18 19:38:21larrysetmessageid: <>
2014-01-18 19:38:21larrylinkissue20178 messages
2014-01-18 19:38:21larrycreate