On Sat, Jul 25, 2015 at 6:23 AM, Carlos Pita <carlosjosep...@gmail.com> wrote: >> > Not sure, but would it be desirable for the decorators to be less dummy and >> > for RuntimeCompiledFunction to take the flags into account when compiling >> > on the fly? >> >> Can you provide a pull request, including tests? > > I don't have much time these days but I gave some thoughts to this and I > would like to hear your opinion about the following proposal before start > coding: > > 1. The compiler-directives, locals, etc. decorators will be less dummy in > two ways: > - They will know how to print a repr of themselves. > - They will register themselves under some "private" attribute (say > _cython_decorators, do you have any preference here?) of the decorated > function. > > 2. Besides get_body(f), RuntimeCompiledFunction will use a new function > get_cython_decorators(f), which returns the concatenated repr of the > registered decorators. > > 3. This block of code will be passed as a new argument (say > cython_decorators) to cython_inline. The module code template will now be: > > module_code = """ > %(module_body)s > %(cimports)s > %(cython_decorators)s > def __invoke(%(params)s): > %(func_body)s > """ > > What do you think?
+1 _______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel