[cfe-dev] Python/CIndex include file support

Daniel Dunbar daniel at zuster.org
Thu Feb 4 08:02:27 PST 2010


On Thu, Feb 4, 2010 at 6:36 AM, Andrew Sutton <andrew.n.sutton at gmail.com> wrote:
>
>> Sorry I haven't had time to look at this yet. I'll try to get to it by
>> the weekend.
>
> No rush.
>
>>
>> One immediate comment though, I would prefer to not expose this via a
>> property. I prefer to use functions (get_includes or so) for features
>> which require significant work, and only use properties for things
>> which are logically O(1). Otherwise the API tends to give the wrong
>> mental model of what is going on under the covers.
>
> I was back and forth on that issue.  Also, I'm not fully convinced that the
> returning tuples is the right thing to do. It might be better to create a
> class called "Inclusion" that explicitly names the including file, included
> file, location, depth, etc.

Yeah, I haven't looked closely, but I think it might make sense to have a class.

> Also, on the CIndex side, is there a plan to support a max-depth on that
> traversal? It's easy enough to emulate from the Python side, but it wouldn't
> actually bound the traversal.

Not currently, and I'm not sure how much efficiency there is to gain
with it. Was there a particular use case?

 - Daniel

>
> Andrew Sutton
> andrew.n.sutton at gmail.com
>




More information about the cfe-dev mailing list