API : constness ?

Tim Peters tim.one at comcast.net
Sun May 30 08:31:36 EDT 2004


[Benoît Dejean]
> i don't understand why the ANSI const keyword is never used in the API.

It is used in the API, and more than once, but it isn't used as often as it
could be used.  It's more likely to appear in newer API functions.  When
Python was first written, most compilers were K&R, and Python avoided ANSI
features until about a decade later (a C89 compiler is required now).  A lot
of the C API survived unchaged across all that time.  There's no objection
to slamming in consts now, but nobody has cared enough to bother doing so.






More information about the Python-list mailing list