Why is python not written in C++ ?

Carl Banks pavlovevidence at gmail.com
Tue Aug 10 20:49:07 CEST 2010

On Aug 10, 12:06 am, Ulrich Eckhardt <eckha... at satorlaser.com> wrote:
> Carl Banks wrote:
> > I highly doubt the Python source would build with a C++ compiler.
> As Christian showed, it doesn't. However, look around the sources a bit.
> There are lots of places where e.g. the returnvalue of malloc() (or,
> rather, the macro that resolves to something like it) is explicitly
> type-cast to the according pointer type. When asked on the developers'
> list, it was said that this was intended for compatibility with C++, e.g.
> in cases where people want to embed Python into their C++ projects. Of
> course, this contradicts Christian's statement that C++ compatibility
> wasn't considered useful enough.

I question why it needs to be compatible with C++ to be able to embed
Python in a C++ project.  How many C++ compilers out there don't come
bundled with a C compiler?

Carl Banks

More information about the Python-list mailing list