[Python-Dev] #include "Python.h"

Andrea Crotti andrea.crotti.0 at gmail.com
Sun Jan 29 19:53:31 CET 2012

On 01/29/2012 06:34 PM, Paul Moore wrote:
> On 29 January 2012 18:10, C. Titus Brown<ctb at msu.edu>  wrote:
>> python-dev isn't that inappropriate, IMO, but probably the best place to
>> go with this discussion is python-ideas.  Could you repost over there?
> I agree that python-dev isn't particularly appropriate, python-list is
> probably your best bet. The python-ideas isn't really appropriate, as
> this isn't a proposal for a change to Python, but rather a question
> about how the Python C code is structured. That's always a grey area,
> and I can see why the OP thought python-dev might be a reasonable
> place.

Ok well for this I won't repost it anywhere else, I have already all
the answers I wanted and it was not so important..

> Having said all that:
>> Python.h actually includes everything as far as I can I see so:
>> - it's very hard with a not-enough smart editor to find out where the
>>   not-locally defined symbols are actually defined (well sure that is
>>   not a problem for most of the people)
> Well, that's more of a question of what tools you use to edit/read
> Python code. I guess you could view it as a trade-off between ease of
> writing the core code and extensions (avoiding micromanagement of
> headers, and being able to document #include "Python.h" as the
> canonical way to get access to the Python API from C) versus tracking
> down macro definitions and symbol declarations (and that's really only
> for information, as the API is documented in the manuals anyway).
> I don't use an editor that can automatically find the definitions, but
> grep and the manuals does me fine.

Yes sure it makes sense, probably it's even better than including
only simple files, since all the contributions to Python.h can be moved
around and refactored without breaking all the code..

And for editor I use Emacs, which can actually do any kind of magic
on the symbols, I just didn't set it up for the python source code..


More information about the Python-Dev mailing list