Stefan Behnel wrote: > > Cool. > > One question, could you tell me what this line in > NewTempExprNode.allocate_target_temps() is doing? > > rhs.release_temp(rhs)
That's a polite way of putting it :-) I suppose it is never called as no LHS-nodes are currently converted. > How about using a dedicated Target class and writing code like this: ... Yes, I like it. Building further on that: There's a couple of possible behaviours in the ExprNode (needs to hand out a temp or not, has an inc-refed result or not), and a couple of possible behaviours in the parent (has target or not, needs to decref target, etc.). So introducing a "mediator" class is not a bad idea so that each side doesn't need to worry about all combinations of cases. It would also possibly be more robust (could be unit tested etc.) *But*, at this stage, when incremental conversion seems possible, I'll resist any such drastic changes, based on the amount of work involved alone. I think there may be cases where the current framework doesn't work, but hopefully one can take a good look at them and introduce new, optional parameters to generate_result_code and/or generate_disposal_code to handle those situations. (I.e. "do_not_release_temp" to the latter one might be needed in some situations.) -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
