C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Exception compatibility with aliens

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Wed, 18 Jan 2023 12:04:41 +0200
On Wed, 18 Jan 2023 at 11:45, Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> I have sent this email to two mailing lists for programming language
> proposals, the one for C++ and the one for Python. If you reply to
> this email, please make sure you reply to both. You can see the
> mailing list archives for this month for each list here:
>
> C++ : https://lists.isocpp.org/std-proposals/2023/01/date.php
> Python : https://mail.python.org/archives/list/python-dev_at_[hidden]/2023/1/
>
> Both C++ and Python have exception handling, however a C++ program
> which links with a Python library is unable to handle an exception
> thrown from Python.

Perhaps you should just use
https://www.boost.org/doc/libs/1_81_0/libs/python/doc/html/index.html

See also https://realpython.com/python-bindings-overview/

In both C++ and Python, exceptions can contain anything as their
payload. The problem becomes a problem of
mapping one language to the other, not just mapping exceptions. That
makes it a general cross-language binding generation problem,
so the forthcoming reflection/injection in C++ can certainly help, but
just having a 'list' of exceptions isn't going to
cut it either way.

Received on 2023-01-18 10:04:54