Locale dependent formatting of lists.
The default locale for the functions in this module is determined by the following environment variables, in that order:
- LC_ALL, and
- LANG
Unknown Field: copyright | |
| |
Unknown Field: license | |
BSD, see LICENSE for more details. |
Function | format_list |
Format the items in lst as a list. |
Constant | DEFAULT_LOCALE |
Undocumented |
Format the items in lst
as a list.
>>> format_list(['apples', 'oranges', 'pears'], locale='en') u'apples, oranges, and pears' >>> format_list(['apples', 'oranges', 'pears'], locale='zh') u'apples、oranges和pears' >>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi') u'omena, peruna tai aplari'
These styles are defined, but not all are necessarily available in all locales. The following text is verbatim from the Unicode TR35-49 spec [1].
[1]: https://www.unicode.org/reports/tr35/tr35-49/tr35-general.html#ListPatterns
Parameters | |
lst | a sequence of items to format in to a list |
style | the style to format the list with. See above for description. |
locale | the locale |