[C++-sig] Pyste and STL types

David Abrahams dave at boost-consulting.com
Tue Mar 18 17:08:26 CET 2003


Stefan Seefeld <seefeld at sympatico.ca> writes:

> Hi there
>
> David Abrahams wrote:
>
>> In other words, in Python everything is a union.
>
> Good point. Along this line, I always thought of boost.python as
> a tool not only to map between languages but also to map between
> idioms (idiosyncrasies), to make the mapping smooth and as natural
> as possible.

Exactly.

> In this light, why would boost.python support unions ? As you point
> out, python uses the concept intrinsically. C++ doesn't need it, so
> it's really just a relict of C. Why not treat it as just that ?

Because we aim as much as possible to support wrapping existing C++
interfaces, relics and all.  In fact, unions are not exactly a relic
except that they aren't as capable as we might like.  Boost just
accepted a C++ variant library which provides a
union-plus-ctor/dtor-and-introspectability, and it makes complete
sense to think about converting those directly to/from Python based
on which type they are holding.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list