[Python-Dev] Opinions on const-correctness?

Tim Peters tim.one@comcast.net
Tue, 12 Mar 2002 19:51:43 -0500


[Greg Ewing]
> A possible compromise would be to provide an alternative
> version of Python.h which has the const declarations, for
> use by extensions that want it. Extensions that didn't
> use it wouldn't be affected, and neither would Python
> itself, which would continue to use the old headers.

-1.  A lot of files go in to "Python.h", and I have a nagging suspicion
you're not volunteering to keep the new mass of almost-duplicates in synch
as time drags on <wink>.

It usually doesn't hurt to add const decorations to argument decls, though,
and I sometimes do when I'm fiddling a header file for some other reason.
Then the Python C-API docs have to change too.

I suggest the people who get some actual good out of adding const add it
when and where they stumble over its lack.  The important cases will get
changed quickly then, and disruption due to unimportant cases won't occur.