Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / doc / ref / python.dox
1 /*! \page python Python wrapping
2
3
4 The main classes and methods are wrapped in Python with 
5 the SWIG tool (at least version 1.3.24)
6
7 \section python_modules Multi modules
8 As in C++ the wrapping is split in 3 modules : engine, runtime, loader
9 so that other runtime or loader can be used with the same engine.
10 We need to be careful with definitions shared by the 3 modules : put
11 them in a unique dynamic library and link the modules with it.
12
13 \section python_exception Exception wrapping
14 In swig, exception can be wrapped either by declaring throw in interface
15 file (.i) or by declaring an exception handler.
16 A generic exception handler has been declared and automatic generation has been 
17 desactivated (SWIG option -noexcept).
18
19 \section python_gil Global Interpreter Lock
20 For some methods we need to release the Python GIL.
21 This is done by using a swig exception handler that releases the lock
22 on entry and reacquires it on exit. 
23
24 \section python_ownership Ownership
25 Some methods (factory mainly) don't give ownership to python. For example,
26 createNode from runtime object returns a newly created node to python but
27 python has not ownership so when it disappears from python, the C++ object
28 is not destroyed.
29 To give ownership to python we use %newobject macro.
30
31 */