Comment 1 for bug 597234

Revision history for this message
Eike (eike-welk) wrote :

An other issue:

You can look up attributes of the ast.Node itself:
    (a + b).function
or
    (a + b).loc

This should off course not be possible. Therefore unevaluated expressions need special treatment in Interpreter.eval_NodeAttrAccess(...).

A safe treatment of this situation is:
- Create a variable of the right type and role, and assign the expression to it.
- Do attribute lookups with this variable.
- Optimize the variable away later.

Nearly all lookups are however for methods. They can be processed without constructing an intermediate variable.