[Cython] Entry.utility_code_definitions vs. Entry.utility_code

mark florisson markflorisson88 at gmail.com
Sun Aug 21 12:57:32 CEST 2011


On 21 August 2011 12:54, mark florisson <markflorisson88 at gmail.com> wrote:
> On 21 August 2011 12:31, Stefan Behnel <stefan_ml at behnel.de> wrote:
>> Hi,
>>
>> is there a reason for having the two?
>>
>> The "uc_definition" is set to instances of "CythonUtilityCode" in
>> UtilityCode.py, whereas the other is used to keep references to
>> "UtilityCode" instances, but both inject their code in the same way, it
>> appears. The first also has dedicated support in the pipeline, whereas
>> support for the latter is spread across the syntax tree nodes.
>>
>> It seems cleaner to me to use the first approach, i.e. to simply walk all
>> used entries at some late point in the pipeline and to inject their utility
>> code, rather than to leave that responsibility to each node that uses them.
>>
>> Anything I misunderstood here? If not, any objections to merging the latter
>> into the first?
>>
>> Stefan
>> _______________________________________________
>> cython-devel mailing list
>> cython-devel at python.org
>> http://mail.python.org/mailman/listinfo/cython-devel
>>
>
> That would be fine with me, as long as it meant no modifications to
> (Cython)UtilityCode or the code in the pipeline, as I have modified
> all of those in _memview.
>
> I see only two cases in ExprNodes of code checking entry.utility_code
> and using the utilities, though. So if I understand correctly, it's
> about those few cases?
>

The code in the pipeline is tailored for CythonUtilityCode only, so I
suppose it would need to be modified. I believe the _memview branch is
nearly finished though, so could you wait for that merge? Otherwise
modifying the pipeline wouldn't be too bad either, it might only give
a few conflicts.


More information about the cython-devel mailing list