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

Re: Learning the Python API - early questions

From: Barry Scott <barry_at_barrys-emacs.org>
Date: 2003-10-19 12:02:23 CEST

At 18-10-2003 22:45, Russell Yanofsky wrote:
>It will if you explicitly instatiate the templates. There's an example of
>this at http://www.swig.org/tutorial.html in the "Surely there's more to
>it..." section. There's also more in-depth documentation on doing this at
>http://www.swig.org/Doc1.3/SWIGPlus.html#n28.

Thanks. I'll look at it.

>PyCXX instead of SWIG? I don't see any advantages to doing that. The main
>advantage that Boost::Python and (presumably) PyCXX have over SWIG is that
>they let you easily access Python features from C++, so you can build cool
>hybrid C++/Python apps. But in this case, you're not implementing parts of
>the library in python, just exposing it all to python. Beyond that, using
>PyCXX would give you two potential disadvantages:

PyCXX allows me to use a very pythonic API. For example I have a revision
object that allows me to:

rev = pysvn.revision()
rev.kind_name = "head"

And a ls that takes keywords and returns a list of dicts for the result
with times converted to python time.

client = pysvn.client()
all_files = client.ls( url, recurse=true, revision=rev )
for file in all_files:
         print file['name']

I can also support threading by releasing the python interpreter lock
around the svn calls.

How would SWIG support all the callbacks?

I can isolate the Python world from crashing from bad param passing.

>1) The SvnCpp bindings wouldn't be able to interoperate with the Subversion
>C bindings.

Why would I need this interop? I don't understand why it matters.

>2) The SvnCpp bindings wouldn't be available to Perl, Java, Ruby, PHP, etc,
>etc users.

My goal is a Python API and I'm not convinced that SWIG can make a
good python API. I know that PyCXX can. SWIG may be good enough to make
the other languages.

BArry

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 19 12:03:05 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.