[Pyrex] char initialisation

Fabien Cromières fabien.cromieres at gmail.com
Tue Sep 27 05:38:47 CEST 2005


OK,
Once again, I should learn to read documentation.
Thanks a lot

Fabien C.

2005/9/27, John Machin <sjmachin at lexicon.net>:
> Fabien Cromières wrote:
>
> >Hi,
> >
> >I have a small problem: I can't find how to affect value to char variables:
> >For example, the classical C syntax doesn't work::
> >
> >cdef char c
> >c='a'
> >
> >here, pyrex understand 'a' as a string (that is a char * ) and refuse
> >to convert it to a char. Same  problem with c="a".
> >For the moment, I use c='a'[0]. It works, but it is not very beautiful.
> >Is there a more elegant way?
> >
> >
> >
> Depends on your definition of "elegance" :-)
> Look at this URL:
> http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/overview.html#Basics
> which contains:
> """
> Character literals are written with a c prefix, for example:
>
> c'X'
> """
>
>



More information about the Pyrex mailing list