locale.format()

locale.format(format, val, grouping=False, monetary=False) Formats a number val according to the current LC_NUMERIC setting. The format follows the conventions of the % operator. For floating point values, the decimal point is modified if appropriate. If grouping is true, also takes the grouping into account. If monetary is true, the conversion uses monetary thousands separator and grouping strings. Please note that this function will only work for exactly one %char specifier. For whole form

locale.Error

exception locale.Error Exception raised when the locale passed to setlocale() is not recognized.

locale.delocalize()

locale.delocalize(string) Converts a string into a normalized number string, following the LC_NUMERIC settings. New in version 3.5.

locale.currency()

locale.currency(val, symbol=True, grouping=False, international=False) Formats a number val according to the current LC_MONETARY settings. The returned string includes the currency symbol if symbol is true, which is the default. If grouping is true (which is not the default), grouping is done with the value. If international is true (which is not the default), the international currency symbol is used. Note that this function will not work with the ‘C’ locale, so you have to set a locale via

locale.atoi()

locale.atoi(string) Converts a string to an integer, following the LC_NUMERIC conventions.

locale.atof()

locale.atof(string) Converts a string to a floating point number, following the LC_NUMERIC settings.

list.sort()

sort(*, key=None, reverse=None) This method sorts the list in place, using only < comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state). sort() accepts two arguments that can only be passed by keyword (keyword-only arguments): key specifies a function of one argument that is used to extract a comparison key from each list element (for example, key=st

list

class list([iterable]) Rather than being a function, list is actually a mutable sequence type, as documented in Lists and Sequence Types — list, tuple, range.

list

class list([iterable]) Lists may be constructed in several ways: Using a pair of square brackets to denote the empty list: [] Using square brackets, separating items with commas: [a], [a, b, c] Using a list comprehension: [x for x in iterable] Using the type constructor: list() or list(iterable) The constructor builds a list whose items are the same and in the same order as iterable‘s items. iterable may be either a sequence, a container that supports iteration, or an iterator object.

linecache.lazycache()

linecache.lazycache(filename, module_globals) Capture enough detail about a non-file-based module to permit getting its lines later via getline() even if module_globals is None in the later call. This avoids doing I/O until a line is actually needed, without having to carry the module globals around indefinitely. New in version 3.5.