On Tue, Jan 25, 2011 at 1:23 AM, Stefan Behnel <stefan...@behnel.de> wrote:
> Robert Bradshaw, 25.01.2011 10:00:
>> On Mon, Jan 24, 2011 at 11:33 PM, Stefan Behnel wrote:
>>> Vitja Makarov, 25.01.2011 08:15:
>>>> I want to write simple code to find unbound variables.
>>
>> I'm assuming you mean unassigned (as opposed to unbound in, e.g., a closure)?
>>[...]
>> It probably wouldn't be too hard to walk the tree to discover this
>> kind of information, recording on each NameNode as one goes along what
>> its possible states are.
>
> A general "NameNode dependency walk" of the tree could give us *loads* of
> information, also for better type inference. Knowing that a Python variable
> is definitely not None from a given point on, or that it has a specific
> type at one point and a different type at another would be really cool.
>
> Basically, we could build a dependency tree for each NameNode (at its
> specific point in the tree, not just through its symtab Entry) that
> references its assignment RHSs, but including a representation of relevant
> branches in the code.

Yes, that's exactly what I was thinking. Each NameNode would have an
associated status (which could contain arbitrary information and have
merge methods) and we would walk the tree updating the status as we
went, merging on the branches.

- Robert
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to