Building Python 2.2.1 for HP Tru64 UNIX V4.0F

Martin v. Loewis martin at v.loewis.de
Thu Oct 10 03:35:20 EDT 2002


"Narendra Raavi" <narendra at att.com> writes:

> 1.a: I am using the --with-pydebug option for configure.

I recommend that you drop this option, or fix Python.

> 2. The problem seems to be (a) the cpp translation of  this macro OR (b) the
> __assert implementation (i'm using the example I provided):

That's a bug in your compiler. assert must be an expression, and
Python expects that assert is an expression, but on your system, it is
a statement.

> 3. My main motivation in using the --with-pydebug option is to be able to
> dump internals to inspect them. Just learning.

Good! then try to understand the problem, and make the proper
modifications to either your compiler, or to Python.

If you want to contribute back, write an autoconf test that checks for
this problem (i.e. whether assert is a statement).

> 5. It appears that there is a bug report that has not been fixed. One fix is
> to replace the assert with a function that actually returns something. I'll
> try to get this working and see if the Python folks would like a fix.

See above. The point of assert is that it is always expanded inline,
as it will then report file and line where the assertion fails. If you
put that in a function, you lose that property.

For systems like yours, I'd rather lose the entire functionality (by
not using assert at all in Py_SAFE_DOWNCAST), instead of losing a
feature on systems that do implement assert correctly.

Regards,
Martin



More information about the Python-list mailing list