rest25/library/locale.rst => rest262/library/locale.rst
487.. data:: ALT_DIGITS
488
489   The return value is a representation of up to 100 values used to represent the
490   values 0 to 99.
491
492Example::
493
494   >>> import locale
n495-   >>> loc = locale.getlocale(locale.LC_ALL) # get current locale
n495+   >>> loc = locale.getlocale() # get current locale
496   >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
n497-   >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut 
n497+   >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
498   >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
499   >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale
500   >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale
501
502
503Background, details, hints, tips and caveats
504--------------------------------------------
505
524yourself that using locale settings is okay.  Only as a last resort should you
525document that your module is not compatible with non-\ ``C`` locale settings.
526
527.. index:: module: string
528
529The case conversion functions in the :mod:`string` module are affected by the
530locale settings.  When a call to the :func:`setlocale` function changes the
531:const:`LC_CTYPE` settings, the variables ``string.lowercase``,
t532-``string.uppercase`` and ``string.letters`` are recalculated.  Note that this
t532+``string.uppercase`` and ``string.letters`` are recalculated.  Note that code
533-code that uses these variable through ':keyword:`from` ... :keyword:`import`
533+that uses these variable through ':keyword:`from` ... :keyword:`import` ...',
534-...', e.g. ``from string import letters``, is not affected by subsequent
534+e.g. ``from string import letters``, is not affected by subsequent
535:func:`setlocale` calls.
536
537The only way to perform numeric operations according to the locale is to use the
538special functions defined by this module: :func:`atof`, :func:`atoi`,
539:func:`format`, :func:`str`.
540
541
542.. _embedding-locale:
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op