adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] SWIG 1.3.14


From: Kai Sterker
Subject: [Adonthell-devel] SWIG 1.3.14
Date: Wed, 21 Aug 2002 23:11:36 +0200

I just installed the latest version of SWIG, and once again it
introduces some incompatibility. The init function of the resulting
module is now called init_adonthell instead of initadonthellc. I have
updated the code and will commit it later today.


Another thing I've seen when browsing the documentation is that the
generated wrapper classes make use of new Python 2.2 features (if Python
2.2 is installed). Directly from the SWIG docs:

"SWIG makes every attempt to preserve backwards compatibility with
older versions of Python to the extent that it is possible.  However,
in Python-2.2, an entirely new type of class system was introduced.
This new-style class system offers many enhancements including static
member functions, properties (managed attributes), and class methods.
Details about all of these changes can be found on www.python.org and is
not repeated here.

To address differences between Python versions, SWIG currently emits
dual-mode proxy class wrappers.  In Python- 2.2 and newer releases,
these wrappers encapsulate C++ objects in new-style classes that take
advantage of new features (static methods and properties).  However,
if these very same wrappers are imported into an older version of
Python, old-style classes are used instead.

This dual-nature of the wrapper code means that you can create extension
modules with SWIG and those modules will work with all versions of
Python ranging from Python-1.4 to the very latest release.  Moreover,
the wrappers take advantage of Python-2.2 features when available.

For the most part, the interface presented to users is the same
regardless of what version of Python is used.  The only incompatibility
lies in the handling of static member functions.  In Python-2.2, they
can be accessed via the class itself.  In Python-2.1 and earlier, they
have to be accessed as a global function or through an instance (see the
earlier section)."


Especially the last paragraph worries me a bit. Does it mean the we need
to access static members in a different way when using Python 2.2? Or is
the old way still supported? 

>From looking at the generated code, I assume that latter is the case.
Even when using 2.2, the old way is still available. However, I can't
test this, as I am still using Python 2.1. Can you have a look, Alex?

Kai

P.S. I've also installed the latest gettext (0.11.5). I'll update the
adonthell sources with that tomorrow.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]