On this page
locale.strcoll
Prev: locale.str | Up: locale | Next: locale.strxfrm
Rel: locale.atof, locale.atoi, locale.currency, locale.Error
Ref: docs.python.org — locale.strcoll
Tags: #public #python3 #stdlib #locale
Import
import locale
from locale import strcoll
Signature & Overview
locale.strcoll(os1, os2, /)
Compares two strings according to the locale.
Usage
import locale
assert locale.strcoll("a", "b") < 0
Gotchas
- Locale-aware comparator (
<0,0,>0): Forsorted(), usekey=locale.strxfrminstead of wrappingstrcollwithcmp_to_key.
REPL Inspect
from locale import strcoll
help(strcoll)
Linked from
Related notes
- tuts/python3/stdlib_module/locale/str Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/strxfrm Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/locale/atof Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/atoi Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/currency Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/Error Linked here; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/format_string shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getdefaultlocale shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getencoding shared tags: #locale, #stdlib