HTML fixes

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12667 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-05-14 01:09:36 +00:00
commit 830e019a09
2 changed files with 34 additions and 21 deletions

View file

@ -1332,6 +1332,11 @@
<li><a href="Python.html#Python_nn28">Further details on the Python class interface</a> <li><a href="Python.html#Python_nn28">Further details on the Python class interface</a>
<ul> <ul>
<li><a href="Python.html#Python_nn29">Proxy classes</a> <li><a href="Python.html#Python_nn29">Proxy classes</a>
<li><a href="Python.html#Python_builtin_classes">Built-in Classes</a>
<ul>
<li><a href="Python.html#Python_builtin_limitations">Limitations</a>
<li><a href="Python.html#Python_builtin_overloads">Operator overloads -- use them!</a>
</ul>
<li><a href="Python.html#Python_nn30">Memory management</a> <li><a href="Python.html#Python_nn30">Memory management</a>
<li><a href="Python.html#Python_nn31">Python 2.2 and classic classes</a> <li><a href="Python.html#Python_nn31">Python 2.2 and classic classes</a>
</ul> </ul>

View file

@ -43,7 +43,11 @@
<li><a href="#Python_nn28">Further details on the Python class interface</a> <li><a href="#Python_nn28">Further details on the Python class interface</a>
<ul> <ul>
<li><a href="#Python_nn29">Proxy classes</a> <li><a href="#Python_nn29">Proxy classes</a>
<li><a href="#Python_BuiltinClasses">Built-in classes</a> <li><a href="#Python_builtin_classes">Built-in Classes</a>
<ul>
<li><a href="#Python_builtin_limitations">Limitations</a>
<li><a href="#Python_builtin_overloads">Operator overloads -- use them!</a>
</ul>
<li><a href="#Python_nn30">Memory management</a> <li><a href="#Python_nn30">Memory management</a>
<li><a href="#Python_nn31">Python 2.2 and classic classes</a> <li><a href="#Python_nn31">Python 2.2 and classic classes</a>
</ul> </ul>
@ -2210,7 +2214,7 @@ unacceptable for a high-performance library. The new <tt>-builtin</tt>
option instructs SWIG to forego the use of proxy classes, and instead option instructs SWIG to forego the use of proxy classes, and instead
create wrapped types as new built-in Python types. When this option is used, create wrapped types as new built-in Python types. When this option is used,
the following section ("Proxy classes") does not apply. Details on the use of the following section ("Proxy classes") does not apply. Details on the use of
the <tt>-builtin</tt> option are in the <a href="#Python_BuiltinClasses">Built-in Classes</a> the <tt>-builtin</tt> option are in the <a href="#Python_builtin_classes">Built-in Classes</a>
section. section.
</p> </p>
@ -2303,7 +2307,8 @@ you can attach new Python methods to the class and you can even inherit from it
by Python built-in types until Python 2.2). by Python built-in types until Python 2.2).
</p> </p>
<H3><a name="Python_BuiltinClasses"></a>33.4.2 Built-in Classes</H3> <H3><a name="Python_builtin_classes"></a>33.4.2 Built-in Classes</H3>
<p> <p>
The <tt>-builtin</tt> option provides a significant performance improvement The <tt>-builtin</tt> option provides a significant performance improvement
@ -2346,23 +2351,25 @@ please refer to the python documentation:</p>
<p><a href="http://docs.python.org/extending/newtypes.html">http://docs.python.org/extending/newtypes.html</a></p> <p><a href="http://docs.python.org/extending/newtypes.html">http://docs.python.org/extending/newtypes.html</a></p>
<H4>33.4.2.1 Limitations</H4> <H4><a name="Python_builtin_limitations"></a>33.4.2.1 Limitations</H4>
<p>Use of the <tt>-builtin</tt> option implies a couple of limitations: <p>Use of the <tt>-builtin</tt> option implies a couple of limitations:
<ul> <ul>
<li><p>python version support:</p></li> <li><p>python version support:</p>
<ul> <ul>
<li>Versions 2.5 and up are fully supported</li> <li>Versions 2.5 and up are fully supported</li>
<li>Versions 2.3 and 2.4 are mostly supported; there are problems with director classes and/or sub-classing a wrapped type in python.</li> <li>Versions 2.3 and 2.4 are mostly supported; there are problems with director classes and/or sub-classing a wrapped type in python.</li>
<li>Versions older than 2.3 are not supported.</li> <li>Versions older than 2.3 are not supported.</li>
</ul> </ul>
<li><p>Some legacy syntax is no longer supported; in particular:</p></li> </li>
<ul> <li><p>Some legacy syntax is no longer supported; in particular:</p>
<li>The functional interface is no longer exposed. For example, you may no longer call <tt>Whizzo.new_CrunchyFrog()</tt>. Instead, you must use <tt>Whizzo.CrunchyFrog()</tt>.</li> <ul>
<li>Static member variables are no longer accessed through the 'cvar' field (e.g., <tt>Dances.cvar.FishSlap</tt>). <li>The functional interface is no longer exposed. For example, you may no longer call <tt>Whizzo.new_CrunchyFrog()</tt>. Instead, you must use <tt>Whizzo.CrunchyFrog()</tt>.</li>
They are instead accessed in the idiomatic way (<tt>Dances.FishSlap</tt>).</li> <li>Static member variables are no longer accessed through the 'cvar' field (e.g., <tt>Dances.cvar.FishSlap</tt>).
</ul> They are instead accessed in the idiomatic way (<tt>Dances.FishSlap</tt>).</li>
<li><p>Wrapped types may not be raised as python exceptions. Here's why: the python internals expect that all sub-classes of Exception will have this struct layout:</p> </ul>
<p>Wrapped types may not be raised as python exceptions. Here's why: the python internals expect that all sub-classes of Exception will have this struct layout:</p>
<div class="code"> <div class="code">
<pre> <pre>
@ -2422,7 +2429,6 @@ class MyPyException (Exception) :
</li> </li>
<li><p>Reverse binary operators (e.g., <tt>__radd__</tt>) are not supported.</p></li> <li><p>Reverse binary operators (e.g., <tt>__radd__</tt>) are not supported.</p></li>
</ul> </ul>
</p>
<p> <p>
To illustrate the last point, if you have a wrapped class called <tt>MyString</tt>, To illustrate the last point, if you have a wrapped class called <tt>MyString</tt>,
@ -2473,7 +2479,8 @@ The above code fails, because the first operand -- a native python string --
doesn't know how to add an instance of <tt>MyString</tt> to itself. doesn't know how to add an instance of <tt>MyString</tt> to itself.
</p> </p>
<H4>33.4.2.2 Operator overloads -- use them!</H4> <H4><a name="Python_builtin_overloads"></a>33.4.2.2 Operator overloads -- use them!</H4>
<p>The entire justification for the <tt>-builtin</tt> option is improved <p>The entire justification for the <tt>-builtin</tt> option is improved
performance. To that end, the best way to squeeze maximum performance out performance. To that end, the best way to squeeze maximum performance out
@ -2491,10 +2498,10 @@ slot entries. For example, suppose you have this class:
<pre> <pre>
class Twit { class Twit {
public: public:
Twit operator+ (const Twit& twit) const; Twit operator+ (const Twit&amp; twit) const;
// Forward to operator+ // Forward to operator+
Twit add (const Twit& twit) const Twit add (const Twit&amp; twit) const
{ return *this + twit; } { return *this + twit; }
}; };
</pre> </pre>
@ -2575,6 +2582,7 @@ structs.
<H3><a name="Python_nn30"></a>33.4.3 Memory management</H3> <H3><a name="Python_nn30"></a>33.4.3 Memory management</H3>
<p>NOTE: Although this section refers to proxy objects, everything here also applies <p>NOTE: Although this section refers to proxy objects, everything here also applies
when the <tt>-builtin</tt> option is used.</p> when the <tt>-builtin</tt> option is used.</p>