[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-15 22:28:58 CEST

At 14-10-2003 22:36, Russell Yanofsky wrote:
>Barry Scott wrote:
> > Is could be fixed in the C API or the Python wrapper. If the C API
> > converted misuse to error codes then the python would just throw
> > python exceptions with ease.
>
>Generally speaking, libraries can't detect when they are being misused. It's
>possible to check for simple cases but only if you're willing to bloat the
>code and take effort that might be better spent improving documentation and
>simplifiying api's so the misuse doesn't happen in the first place. I am a
>little sympathetic to the idea, though, because error messages probably make
>a better impression on scripting language users than segfaults.

There is a sort of weak design-by-contract going on with the asserts enforcing
contract violations. For non C/C++ use those contract violation need to
be errors reported under control. The starting point would be to change
the asserts into error returning checks. The asserts could still be in
for debug builds.

> > Again the RapidSVN api may make this a lot easier. I'm watching for
> > the patch to bring RapidSVN up to 0.30.0 compatibility.
>
>Yeah, the RapidSVN API looks a lot less error prone. And they actually
>mention swig on their homepage, http://rapidsvn.tigris.org/svncpp.html, so
>it was probably designed to be swigified

I have a prototype that seems to work, but it needs some patches that I've
submitted to the rapidsvn folks. It also has the crash if misused, but there
are far fewer holes to plug.

Barry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 15 22:30:37 2003

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

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