[Cython] Entry.utility_code_definitions vs. Entry.utility_code

mark florisson markflorisson88 at gmail.com
Sun Aug 21 12:54:47 CEST 2011

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?

More information about the cython-devel mailing list