[Python-Dev] API bloat

M.-A. Lemburg mal at egenix.com
Thu Feb 10 14:51:59 CET 2011


Mark Shannon wrote:
> Nick Coghlan wrote:
>> On Thu, Feb 10, 2011 at 8:16 PM, Mark Shannon <marks at dcs.gla.ac.uk>
>> wrote:
>>> Doing a search for the regex:  "PyAPI_FUNC\([^)]*\) *Py" in .h files,
>>> which should match API functions (functions starting _Py are
>>> excluded) gives
>>> the following result:
>>>
>>> Version  matches
>>> 3.0       717
>>> 3.1.3     728
>>> 3.2b2     743
>>>
>>> It would appear the API  bloat is real,
>>> not just an artefact of updated docs.
>>
>> Since it doesn't account for #ifdef, a naive count like that isn't a
>> valid basis for comparison.
>>
> OK. How about this:
> 
> egrep -ho '#.*PyAPI_FUNC\([^)]*\)( |\n)*Py\w+' Include/*.h
> finds no matches.
> 
> egrep -ho 'PyAPI_FUNC\([^)]*\)( |\n)*Py\w+' Include/*.h | sort -u
> 
> This finds all matches and removes duplicates, so anything defined
> multiple time in branches of #ifdef blocks, will only be counted once.
> 
> Version  matches
> 3.0       714
> 3.1.3     725
> 3.2b2     739

Given these numbers, I don't think the subject line really
captures the problem accurately enough ... a 2% increase
in number of API function per release can hardly be called
API bloat :-)

> So given, the revised numbers;
> 
> The "what's new for 3.2" API section:
> http://docs.python.org/dev/py3k/whatsnew/3.2.html#build-and-c-api-changes
> lists 6 new functions, yet 14 have been added between 3.1.3 and 3.2b2.

Could you identify the ones that are not yet documented ?

That would be useful.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 10 2011)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-Dev mailing list