[C++-sig] Re: passing a dynamic PyObject * from C++ to Python
F. Oliver Gathmann
gathmann at cenix-bioscience.com
Mon Jun 30 08:30:21 CEST 2003
David Abrahams wrote:
>Since you have those converters registered, why not simply:
>
> object readFooOrBar(bool fooOrBar)
> { if (fooOrBar)
> {
> std::auto_ptr<Foo> p(new Foo());
> return object(p);
> }
> else
> {
> std::auto_ptr<Bar> p(new Bar());
> return object(p);
> }
> }
>
>??
>
>That seems much easier to me.
>
>
>
Doh! I thought I had tried this - works like a charme. Many thanks for
pointing this out (particularly given the fact that you are on vacation
this week...).
Oliver
--
--------------------------------------------------------------------
F. Oliver Gathmann, Ph.D.
Director IT Unit
Cenix BioScience GmbH
Pfotenhauer Strasse 108 phone: +49 (351) 210-2735
D-01307 Dresden, Germany fax: +49 (351) 210-1309
fingerprint: 8E0E 9A64 A07E 0D1A D302 34C2 421A AE9F 4E13 A009
public key: http://www.cenix-bioscience.com/public_keys/gathmann.gpg
--------------------------------------------------------------------
More information about the Cplusplus-sig
mailing list