[Cython] Dash in the executable's filename

Robert Bradshaw robertwb at gmail.com
Fri Apr 24 18:36:52 CEST 2015


There are other differences when complaining in embed mode, such as
generating a main method. I view the c file as an intermediate that
depends on the compilation mode--if you want both generate two .c
files.

On Fri, Apr 24, 2015 at 1:45 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Robert Bradshaw schrieb am 24.04.2015 um 10:31:
>> On Thu, Apr 23, 2015 at 2:22 AM, Anton D. Kachalov wrote:
>>> I've found that executable script with dashes in the filename lead to
>>> produce wrong cythonized source:
>>>
>>>    $ touch my-great-script.py
>>>    $ cython my-great-script.py --embed
>>>    $ fgrep PyInit my-great-script.c
>>> PyMODINIT_FUNC PyInit_my-great-script(void); /*proto*/
>>> PyMODINIT_FUNC PyInit_my-great-script(void)
>>>   __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_my-great-script(void)",
>>> 0);
>>>           m = PyInit_my-great-script();
>>>
>>> So, if I don't want to import my final script elsewhere, I'm free to choose
>>> any filename for it.
>>
>> Good point: https://github.com/cython/cython/commit/e0fd2b3c8265ea40084ee9981d8601bc6e11b97e
>
> I think the emphasis is on "*if* I don't want to import ...". Just because
> you want to be able to run a module as a program doesn't mean you will
> never import it as module, does it? I think being able to get both from the
> same generated .c file isn't a bad thing.
>
> Stefan
>
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> https://mail.python.org/mailman/listinfo/cython-devel


More information about the cython-devel mailing list