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

2021-06-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI, sqlite3 was converted to Argument Clinic in bpo-40956.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2020-06-07 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-09-08 Thread Berker Peksag


Berker Peksag  added the comment:

I'm working on converting Modules/_sqlite/* to Argument Clinic.

--
nosy: +berker.peksag
versions: +Python 3.8 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2015-05-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For Modules/_curses_panel.c there is special issue, #20171, with the patch.

issue20178-sqlite-01.patch is applied almost clearly, but due to changes to 
Argument Clinic it should be updated. Perhaps more functions can be converted 
(functions that don't use PyArg_Parse* are worth to be converted too).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2015-05-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

issue20178-cyptes-01.patch is outdated due to changes in Argument Clinic and 
ctypes. Here is updated and extended patch.

--
nosy: +serhiy.storchaka
stage: needs patch -> patch review
Added file: http://bugs.python.org/file39296/issue20178-cyptes-02.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2015-02-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Argument Clinic

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-08-04 Thread Larry Hastings

Larry Hastings added the comment:

All the Derby patches should only go into trunk at this point.

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-18 Thread Larry Hastings

Larry Hastings added the comment:

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.

Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-17 Thread Larry Hastings

Larry Hastings added the comment:

Meador: I'm going to change Argument Clinic so you can get the "args" and 
"kwargs" values passed in to the impl.  That's issue #20291; I already added 
you to it "nosy" list.  With that change in you'll be able to convert 
"sqlite3.connect".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-15 Thread Larry Hastings

Larry Hastings added the comment:

All the functions in curses_panel are convertable.  The threeMETH_NOARGS 
functions simply get no arguments.  And here's new_panel:

new_panel
  window: object(subclass_of='&PyCursesWindow_Type')
  /

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-15 Thread Larry Hastings

Larry Hastings added the comment:

In the past few days I added "cloning" functions, which lets you reuse the 
parameters and return converter from an existing function.  That might help 
with Modules/_ctypes/_ctypes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-14 Thread Meador Inge

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-12 Thread Meador Inge

Meador Inge added the comment:

None of the sites in Modules/_curses_panel.c look convertible.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-12 Thread Meador Inge

Meador Inge added the comment:

Larry, the attached patch converts what is convertible of
Modules/_ctypes/_ctypes.  Although, I ran into an odd case
with this conversion: the converted functions are each used
in *multiple* PyMethodDef tables.  So while clinic can generate
equivalent code, the builtins are not all pinned to one type.
The type I pinned it to is the same type that the methods
are documented against:
http://docs.python.org/2/library/ctypes.html#ctypes._CData

Since clinic makes you explicitly specify the fully qualified method
name, I assume sharing like this is not allowed.

Thoughts?

--
keywords: +patch
Added file: http://bugs.python.org/file33438/issue20178-cyptes-01.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-09 Thread Meador Inge

Meador Inge added the comment:

I will pick this one up.

--
assignee:  -> meador.inge
nosy: +meador.inge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-07 Thread Larry Hastings

New submission from Larry Hastings:

This issue is part of the Great Argument Clinic Conversion Derby,
where we're trying to convert as much of Python 3.4 to use
Argument Clinic as we can before Release Candidate 1 on January 19.

This issue asks you to change the following bundle of files:
Modules/_ctypes/_ctypes.c: 8 sites
Modules/_ctypes/_ctypes_test.c: 1 sites
Modules/_ctypes/callproc.c: 14 sites
Modules/_ctypes/stgdict.c: 0 sites
Modules/_curses_panel.c: 3 sites
Modules/_sqlite/cache.c: 1 sites
Modules/_sqlite/connection.c: 12 sites
Modules/_sqlite/cursor.c: 5 sites
Modules/_sqlite/microprotocols.c: 1 sites
Modules/_sqlite/module.c: 6 sites
Modules/_sqlite/row.c: 1 sites

Talk to me (larry) if you only want to attack part of a bundle.

For instructions on how to convert a function to work with Argument
Clinic, read the "howto":
http://docs.python.org/dev/howto/clinic.html

--
components: Extension Modules
messages: 207634
nosy: larry
priority: normal
severity: normal
stage: needs patch
status: open
title: Derby #9: Convert 52 sites to Argument Clinic across 11 files
type: enhancement
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com