Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread Terry Reedy
On 1/23/2014 7:36 AM, Tim Chase wrote: On 2014-01-23 05:43, Terry Reedy wrote: A list instead of a tuple does work, but not an iterable, so 'sequence'. In the OP's case using sqlite drivers, this is true. However, I maintain some old 2.4 code that uses a correspondingly ancient version of mx.

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread Rustom Mody
On Thursday, January 23, 2014 4:13:26 PM UTC+5:30, Terry Reedy wrote: > http://bugs.python.org/issue20364 Thanks for that! I would have preferred a slightly louder warning with respect to singleton tuples given that: 1. Singleton tuple syntax is not consistent with other-length tuples 2. This i

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread Tim Chase
On 2014-01-23 05:43, Terry Reedy wrote: > A list instead of a tuple does work, but not an iterable, so > 'sequence'. In the OP's case using sqlite drivers, this is true. However, I maintain some old 2.4 code that uses a correspondingly ancient version of mx.ODBC which requires a tuple and raises

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread Terry Reedy
On 1/23/2014 12:35 AM, Rustom Mody wrote: On Thursday, January 23, 2014 10:11:42 AM UTC+5:30, Chris Angelico wrote: I think it's fairly clear from the example that it has to be either a tuple or a dict. Looks fine to me. yes 'from the example' and only from there! 'parameters' is a single pa

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread Rustom Mody
On Thursday, January 23, 2014 3:15:07 PM UTC+5:30, lgabiot wrote: > Le 23/01/14 10:04, Mark Lawrence a écrit : > > No, you need to remember how to type xyz into your favourite search > > engine. For this case xyz would be something like "python single > > element tuple". > No big deal, but I don'

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread lgabiot
Le 23/01/14 10:04, Mark Lawrence a écrit : No, you need to remember how to type xyz into your favourite search engine. For this case xyz would be something like "python single element tuple". No big deal, but I don't think you are correct. Problem was that for me I "knew" (it was erroneous o

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-23 Thread Mark Lawrence
On 23/01/2014 07:37, lgabiot wrote: Thanks to all, that was indeed the tuple issue! the correct code is: >>>cursor = conn.execute("SELECT filename, filepath FROM files WHERE max_levelhttps://wiki.python.org/moin/TupleSyntax best regards. No, you need to remember how to type xyz into your f

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Chris Angelico
On Thu, Jan 23, 2014 at 6:18 PM, Asaf Las wrote: > if (!PyArg_ParseTuple(args, "OO", &operation, &second_argument)) { > goto error; > } That part just asks for "any object" as the second argument. Also, that part is handling executemany(). Later on, the execute() handl

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread lgabiot
Thanks to all, that was indeed the tuple issue! the correct code is: >>>cursor = conn.execute("SELECT filename, filepath FROM files WHERE max_level as was pointed out by many. Sorry for missing such a silly point (well, a comma in fact). I'll learn to read more seriously the doc, but I was r

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Asaf Las
On Thursday, January 23, 2014 6:41:42 AM UTC+2, Chris Angelico wrote: > On Thu, Jan 23, 2014 at 3:33 PM, Rustom Mody wrote: > I think it's fairly clear from the example that it has to be either a > tuple or a dict. Looks fine to me. But I'm sure that, if you come up > with better wording, a tracke

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Chris Angelico
On Thu, Jan 23, 2014 at 4:35 PM, Rustom Mody wrote: > On Thursday, January 23, 2014 10:11:42 AM UTC+5:30, Chris Angelico wrote: >> I think it's fairly clear from the example that it has to be either a >> tuple or a dict. Looks fine to me. > > yes 'from the example' and only from there! The fact t

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Rustom Mody
On Thursday, January 23, 2014 10:11:42 AM UTC+5:30, Chris Angelico wrote: > I think it's fairly clear from the example that it has to be either a > tuple or a dict. Looks fine to me. yes 'from the example' and only from there! -- https://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Chris Angelico
On Thu, Jan 23, 2014 at 3:33 PM, Rustom Mody wrote: > On Thursday, January 23, 2014 8:35:58 AM UTC+5:30, Tim Chase wrote: >> On 2014-01-23 03:32, lgabiot wrote: >> > >>>cursor = conn.execute("SELECT filename, filepath FROM files >> > >>>WHERE >> > max_level<(?)", threshold) >> > that doesn't wo

Re: sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Rustom Mody
On Thursday, January 23, 2014 10:03:43 AM UTC+5:30, Rustom Mody wrote: > The builtin connection.execute is even less helpful I meant help(conn.execute) -- https://mail.python.org/mailman/listinfo/python-list

sqlite3 docbug (was problem with sqlite3)

2014-01-22 Thread Rustom Mody
On Thursday, January 23, 2014 8:35:58 AM UTC+5:30, Tim Chase wrote: > On 2014-01-23 03:32, lgabiot wrote: > > >>>cursor = conn.execute("SELECT filename, filepath FROM files > > >>>WHERE > > max_level<(?)", threshold) > > that doesn't work (throw an exception) > That last argument should be a