Ron Adam wrote:

> locale.setlocale(locale.LC_ALL, '')  # use current locale settings

It's not current locale settings, it's user's locale settings.
Application can actually use something else and you will overwrite
that. You can also affect (unexpectedly to the application)
time.strftime() and C extensions. So you should move this call into the
_test() function and put explanation into the documentation that
application should call locale.setlocale


>          self.numrex = re.compile(r'([\d\.]*|\D*)', re.LOCALE)

[snip]

>          if NUMERICAL in self.flags:
>              slist = self.numrex.split(s)
>              for i, x in enumerate(slist):
>                  try:
>                      slist[i] = float(x)
>                  except:
>                      slist[i] = locale.strxfrm(x)

I think you should call locale.atof instead of float, since you call
re.compile with re.LOCALE.

Everything else looks fine. The biggest missing piece is support for
unicode strings.

  -- Leo.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to