[Zope-DB] Re: ZPsycopgDA (version 1.0.13) problems

Charlie Clark charlie@begeistert.org
Thu, 23 Jan 2003 00:01:58 +0100


On 2003-01-22 at 16:24:40 [+0100], Jon Erickson wrote:
> How about a null max_rows value to equal "no limits".  If the content 
> manager wants all rows from the query returned, he leaves max_rows blank.=
 
>  If he wants to restrict the size of the result set, he can provide an 
> integer value.
> 
> To me, it seems non-intuative that a max_rows value of "0" =3D=3D "return=
 all 
> rows".

Try the following
$ python
Python 2.1.2 (#1, Jan 26 2002, 03:26:04)
[GCC 2.9-beos-991026] on beos5
Type "copyright", "credits" or "license" for more information.
>>> d =3D 0
>>> if d: print "d exists"

It won't print anything because 0 is like '' or None. So in Python it makes=
 
perfect sense to check to see if a value is 0 (it's nearly the same as it 
not having a value). Marc-Andr=E9's suggestion to check explicitly for True=
 
or False is easier to understand.

Charlie=20