Hi,
please don't top-post.
Ian Bell, 27.04.2012 09:53:
> Sorry I should have worded my question better. Definitely cdef extern...
> is not valid CPython syntax. My question is more about the compilation of
> a file using Cython. From the standpoint of Cython, you should be able to
> call the file whatever you like, should you not?
No. Cython can compile Python code and it can compile Cython code, which
are not the same thing. Python syntax is a subset of the Cython syntax, so
you can use any Python code file as Cython code file (minus compiler bugs),
but you cannot use an arbitrary Cython code file as Python code file, and
both Python and Cython should tell you that if you try. Thus, the
distinction between the two can only safely be done based on the filename
extension. Essentially, that's what filename extensions are there for: to
provide a visible distinction between different file types.
> In principle I should be
> able to call the file A.abc and then compile the file using distutils,
> right? Assuming that I make the necessary changes to setup.py
I really don't understand why you would want to do this. Would you name
your PDF files "text.guesswhatiam" instead of "text.pdf"? Or rename your .c
files to .py to be able to pass them into a Python interpreter?
Stefan