[issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files

Meador Inge report at bugs.python.org
Wed Jan 15 03:20:06 CET 2014


Meador Inge added the comment:

Attached is a first cut for sqlite3.  It is generally OK, but I have the following
nits:

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

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

    * 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.

    * 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.

    * 'sqlite3.complete' uses 'as module_complete' because 'sqlite3_complete'
      is a public SQLite API function: http://www.sqlite.org/c3ref/complete.html.
      I used 'as' on all the other functions in 'module.c' as well.  Mainly
      for local consistency.

    * '_pysqlite_query_execute' required a little refactoring due to the fact
      that it is a utility function used to implement 'sqlite3.Cursor.execute'
      and 'sqlite3.Cursor.executemany'.  'PyArg_ParseTuple' was being called in
      different way depending on a control parameter.

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

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

----------
Added file: http://bugs.python.org/file33470/issue20178-sqlite-01.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20178>
_______________________________________


More information about the Python-bugs-list mailing list