[Cython] Utility Codes and templates
Stefan Behnel
stefan_ml at behnel.de
Tue Jul 26 08:39:04 CEST 2011
Robert Bradshaw, 26.07.2011 06:29:
> On Mon, Jul 25, 2011 at 3:07 AM, mark florisson
>> It's now 'MyUtility' and
>> 'MyUtility.proto'. If there's no objection to the ini-style header
>> (with requirements and other metadata possibly), then I'll implement
>> that one of these days.
>
> One drawback with the ini style is that it detaches the metadata from
> the code block itself (and require duplicating their names).
The names are duplicated in the file already, since impl and proto are
separated and can be anywhere in the file (e.g., you could put all protos
at the top and all implementation parts further down). The advantages of
putting in a header is that
a) it's immediately visible from the top of the file what it contains
b) the dependencies on other files are explicit and clearly visible, again,
from the top of the file
c) the metadata is easy and quick to parse, as the header is trivially
separated from the rest
d) only the header needs to be parsed in order to know what can be found in
it or what other files are required to compile it
e) we don't need to write our own parser, and the overall file format is
trivial to parse
Stefan
More information about the cython-devel
mailing list