You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/03/18 16:35:43 UTC
svn commit: r1457815 - in /subversion/trunk/subversion/bindings/swig:
INSTALL python/README
Author: danielsh
Date: Mon Mar 18 15:35:43 2013
New Revision: 1457815
URL: http://svn.apache.org/r1457815
Log:
swig-py: Belatedly document importing fully-qualified C function names.
* subversion/bindings/swig/INSTALL
Teak wording.
* subversion/bindings/swig/python/README
Document the alternatives in detail.
Modified:
subversion/trunk/subversion/bindings/swig/INSTALL
subversion/trunk/subversion/bindings/swig/python/README
Modified: subversion/trunk/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/INSTALL?rev=1457815&r1=1457814&r2=1457815&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/INSTALL (original)
+++ subversion/trunk/subversion/bindings/swig/INSTALL Mon Mar 18 15:35:43 2013
@@ -368,7 +368,7 @@ USING SWIG BINDINGS
3. The APIs available within each module are broadly the same as the
corresponding C APIs except:
- * omit the module prefix (for example, 'svn_client_')
+ * you may omit the module prefix (for example, 'svn_client_')
* pool arguments are optional
* using Python exceptions instead of returning svn_error_t
* returning a tuple of outputs instead of return-by-pointer
Modified: subversion/trunk/subversion/bindings/swig/python/README
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/python/README?rev=1457815&r1=1457814&r2=1457815&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/python/README (original)
+++ subversion/trunk/subversion/bindings/swig/python/README Mon Mar 18 15:35:43 2013
@@ -5,6 +5,25 @@ TRANSLATING PARAMETER LISTS
The argument-reductions laws of the SWIG bindings something go like
this:
+ - The module prefix can be omitted. o:
+
+ void *some_C_function = svn_client_foo;
+
+ becomes:
+
+ import svn.client
+ func = svn.client.foo
+
+ However, the following two alternatives also work:
+
+ # Fully-qualified C name
+ import svn.client
+ func = svn.client.svn_client_foo
+
+ # Star-import imports just svn_* names, not bare 'foo' names.
+ from svn.client import *
+ func = svn_client_foo
+
- Python functions don't return errors. They throw exceptions.
Which means that...