[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r24909 - branches/ctypes-python-bindings/csvn/core

From: David James <james_at_cs.toronto.edu>
Date: 2007-05-03 17:46:23 CEST

On 5/3/07, Malcolm Rowe <malcolm-svn-dev@farside.org.uk> wrote:
> I'm curious: how do these differ from Python (2.5's) True and False?
> Are we expecting that people will use TRUE and FALSE in their code, or
> are they just an implementation detail?

They don't differ -- TRUE and FALSE are exactly the same as Python's
underlying 'True' and 'False'. You can actually use them
interchangeably. ctypes will convert 'True' into 1 and 'False' into 0
automatically.

ctypesgen only exports defines to Python if they are defined in a
Subversion header file. 'TRUE' and 'FALSE' are only defined in a
Subversion header file if they aren't defined by a system header. As a
result, TRUE and FALSE are only exported to Python on some platforms.
To fix this, David added a definition for these constants into
__init__.py.

I don't care whether users use 'TRUE' or 'True' in their code. I do
think that users should be able to use 'TRUE' in their code because
the Subversion API docs mention this constant. Alternatively, some
users may wish to use 'True' because this is the standard Python
syntax for boolean truth. Either way is fine with me, so we let users
use either syntax.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 3 17:46:30 2007

This is an archived mail posted to the Subversion Dev mailing list.