Robert Bradshaw, 28.05.2011 18:14:
On Sat, May 28, 2011 at 1:15 AM, Vitja Makarov wrote:
So maybe I should add functions like __Pyx_RaiseUnboundLocalError and
__Pyx_RaiseClosureNameError that will use 3) way.
How do you like put_error_if_unbound CCodeWriter method is that right
place for it?
I don't think abstracting it out to a function really saves anything
here given that Python already has PyErr_Format.
Agreed. The existing functions are only there because they are used in
multiple places, and usually receive formatting arguments. So putting them
into one function makes it easier to keep the message consistent etc.
I also checked that even if you only call PyErr_Format() with multiple
constant string arguments, without going through a function that explicitly
declares them "const char*", gcc considers them "const char*" automatically
and reuses the same constant in different places.
Stefan
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel