On Thu, Dec 3, 2009 at 3:25 PM, Robert Bradshaw
<[email protected]> wrote:
>
> Not at all. I'm up for a default, but that's not my issue. The
> motivating issue is that the user has to manually do something /every
> time/ a char* is converted. I would guess in most (almost all)
> applications one wants the same behavior throughout a whole module.
>

BTW, do you expect that these /every time/ would actually be /many
times/ ?? In my projects, strings appear in a rather small percent of
the C calls I have to use/wrap.

I would love to ask Cython to generate a warning every time that a
char*<->object coercion is implicitly done (I mean, done without an
explicit <object> cast or decode/encode method calls). If Cython could
be instructed to point me to these locations, then I'll have a chance
to eliminate bugs (like unintentionally returning bytes instead of
str/unicode) and perhaps think a bit more about where char* means data
or text at every place the coercion is done.

Such approach would provide "better safe than sorry"
alternative/complement to Robert's proposal. I think this should be
more or less trivial to implement, right? Then Robert could try to run
Cython on the whole Sage an report the outcome.


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to