[Python-Dev] Re: [Python-checkins] python/dist/src/Include co mpile.h,2.38,2.39 parsetok.h,2.19,2.20 pyerrors.h,2.63,2.64 pythonrun.h,2 .55,2.56 symtable.h,2.10,2.11

Martin v. Löwis Martin v. Löwis
Thu, 12 Dec 2002 10:11:42 +0100


> Great and now those who want to avoid warnings have to
> patch their old code :-(

Why is that? Nobody has to change anything.

>> Can you explain where such silencing would be necessary, for the
>> specific patch in question? It is not, because non of the variables
>> that got const now are ever passed to 2.1 API: they are all internal
>> to the core.

> They are ? The pythonrun.h changes were public in 2.1 as well
> and they include some of the more common APIs like the
>PyRun_*() APIs.

Right. But those changes will no author of extension modules force to
change anything. The PyRun_ functions now expect const char*. Existing
code will pass char*. No problem, this is well-formed C. In addition,
people who want to pass const char* can now do so without using a cast,
which they previously couldn't. The only necessary subsequential change
is *inside* the PyRun_ functions, where the types of local variables had
to be changed, and the types of PyParse_ functions, etc.

Developers of the Python core have to keep this in mind when changing
the Python core. Nobody else has to change anything.

Regards,
Martin