[Cython] Message system refactoring

Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no
Mon Mar 21 11:51:10 CET 2011


On 03/21/2011 11:45 AM, Vitja Makarov wrote:
> Now error/warning messages are stored in global variables at
> Cython.Compiler.Errors
>
> I think it's much better to move error handling into some object,
> Main.Context for example.
>
> Some benefits:
>   - reduce use of global variables
>   - allow more then one cython compiler instance at the time
>   - make it much easy to implement -Werror
>   - cython directives can affect message system (fast_fail, werror)
>   - messages could be easily sorted

+1. I assume the reason this is not done is simply because it would be a 
lot of work and the payback is less than spending time on other stuff.

By attaching the error context to "env" and "code" one can avoid a lot 
of signature changes. I think transforms should take the context in 
their constructor.

Dag Sverre



More information about the cython-devel mailing list