[Numpy-discussion] formatting issues, locale and co

David Cournapeau david@ar.media.kyoto-u.ac...
Sun Dec 28 00:40:47 CST 2008


Robert Kern wrote:
>
> We should not support locales. The string representations of these
> elements should be Python-parseable.
>   

It looks like I was wrong in my analysis of the problem: I thought I was
using the most recent implementation of PyOS_* functions in my test
codes, but the ones in 2.6 are not the same as the ones in the current
trunk. So the problem may be easier to fix that what I first thought:
simply providing our own PyOS_ascii_formatd (and similar for float and
long double) may be enough, and since we don't care about locale (%Z and
%n), the function is simple (and can be pulled out from python sources).

We would then use PyOS_ascii_format* (locale independant) instead of
PyOS_snprintf (locale dependant) in str/repr implementation of scalar
arrays. Does that sound acceptable to you ?

cheers,

David


More information about the Numpy-discussion mailing list