[Python-Dev] C++ for CPython 3? (Re: str.count is slow)

Walter Dörwald walter at livinglogic.de
Wed Mar 1 17:30:37 CET 2006


martin at v.loewis.de wrote:

> Zitat von Ulrich Berning <ulrich.berning at denviso.de>:
> 
>> I can't see many advantages in moving to C++, but a lot of disadvantages:
> 
> There are a few advantages, though, mainly:
> - increased type-safety, in particular for API that isn't type-checked
>   at all at the moment (e.g. PyArg_ParseTuple)
> - more reliable reference counting, due to destructors of local
>   variables

Indeed, smart pointers should get rid of most reference counting problems.

> - "native" exception handling, making exceptions both less error-prone
>   and possible more efficient.

Another advantage might be using inline functions instead of macros with 
do {foo} while(0).

Bye,
    Walter Dörwald


More information about the Python-Dev mailing list