[Cython] analyse_types() refactoring

Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no
Thu Feb 7 22:04:51 CET 2013


On 02/07/2013 06:32 PM, Stefan Behnel wrote:
> Hi,
>
> I finally found the time to refactor the analysis phase.
>
> https://github.com/cython/cython/commit/f9c385e08401ed96b5b0afb8411480037dc772b9
>
> The methods now return a node, which allows them to replace themselves with
> a different implementation.
>
> Note that the relatively large code impact of this change also means that
> you might easily run into merge conflicts with your own local changes, so
> here's how to fix them. The transformation pattern is pretty straight
> forward. The "analyse_types()" method returns "self", unless it wants to
> replace itself, i.e. this
>
>      def analyse_types(self, env):
>          self.index.analyse_types(env)
>
> becomes
>
>      def analyse_types(self, env):
>          self.index = self.index.analyse_types(env)
>          return self

Wohoo!

Dag Sverre


More information about the cython-devel mailing list