[Python-Dev] Maybe we should have a C++ extension for testing...

"Martin v. Löwis" martin at v.loewis.de
Sat Sep 23 14:43:55 CEST 2006


skip at pobox.com schrieb:
> One of our C++ gurus (that's definitely not me!) patched the Python source
> to include <wchar.h> at the top of Python.h.  That seems to have solved our
> problems, but seems to be a symptomatic fix.

Indeed. The right fix is likely different, and relates to the question
what API Sun defines in its header files, and which of these which gcc
version uses.

> I got to thinking, should we
> a) encourage people to compile Python with a C++ compiler if most/all of
> their extensions are written in C++ anyway (does that even work if one or
> more extensions are written in C?)

I can't see how this could help. The problem you have is specific to
Solaris, and specific to using GCC on Solaris. This is just a tiny
fraction of Python users. Without further investigation, it might
be even depending on the specific version of GCC being used (and
the specific Solaris version).

> or b) should the standard distribution
> maybe include a toy extension written in C++ whose sole purpose is to test
> for cross-language problems?

Again, this isn't likely to help. If such a problem exist, it is only
found if somebody builds Python on that platform. You are perhaps the
first one to do in this specific combination, so you would have
encountered the problem first. Would that have helped you?

> Either/or/neither/something else?

Something else. Find and understand all platform quirks on platforms we
encounter, and come up with a solution. Fix them one by one, as we
encounter them, and document all work-arounds being made, so we can
take them out when the system disappears (or subsequent releases fixed
the platform bugs).

Doing so requires a good understanding of C and C++, of course.

Regards,
Martin


More information about the Python-Dev mailing list