[C++-sig] working around the non-const Python C API

David Abrahams dave at boost-consulting.com
Sat Dec 3 00:39:41 CET 2005


Tim Peters <tim.peters at gmail.com> writes:

> [Jeremy Hylton]
>> ...
>> Secondarily, I know that python-dev is a bit hesitant about const
>> correctness, but we did get some const char* types added with the new
>> bytecode compiler.  Perhaps it's worthwhile to try changing a few of
>> the most egregious cases to use const char*.
>
> Nobody will complain about adding const where its lack gets in the
> way.  What python-dev doesn't want is another of those massive
> checkins where someone more-or-less mindlessly adds const to every
> place they can find, introducing a handful of subtle bugs along the
> way that create new problems for years.  

I'm not, by any means, advocating slash-and-burn checkins, but...
unless 'C' has adopted overloading while I wasn't looking (and no, I
don't mean the new magic C99 builtin numeric function overloads), it's
hard to imagine what kind of problems you could introduce in `C' code
by changing char* to char const* that wouldn't be caught at
compile-time.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list