string.whitespace

string.whitespace A string containing all ASCII characters that are considered whitespace. This includes the characters space, tab, linefeed, return, formfeed, and vertical tab.

string.Template.template

template This is the object passed to the constructor’s template argument. In general, you shouldn’t change it, but read-only access is not enforced.

string.Template.substitute()

substitute(mapping, **kwds) Performs the template substitution, returning a new string. mapping is any dictionary-like object with keys that match the placeholders in the template. Alternatively, you can provide keyword arguments, where the keywords are the placeholders. When both mapping and kwds are given and there are duplicates, the placeholders from kwds take precedence.

string.Template.safe_substitute()

safe_substitute(mapping, **kwds) Like substitute(), except that if placeholders are missing from mapping and kwds, instead of raising a KeyError exception, the original placeholder will appear in the resulting string intact. Also, unlike with substitute(), any other appearances of the $ will simply return $ instead of raising ValueError. While other exceptions may still occur, this method is called “safe” because substitutions always tries to return a usable string instead of raising an exce

string.Template

class string.Template(template) The constructor takes a single argument which is the template string. substitute(mapping, **kwds) Performs the template substitution, returning a new string. mapping is any dictionary-like object with keys that match the placeholders in the template. Alternatively, you can provide keyword arguments, where the keywords are the placeholders. When both mapping and kwds are given and there are duplicates, the placeholders from kwds take precedence. safe_sub

string.punctuation

string.punctuation String of ASCII characters which are considered punctuation characters in the C locale.

string.printable

string.printable String of ASCII characters which are considered printable. This is a combination of digits, ascii_letters, punctuation, and whitespace.

string.octdigits

string.octdigits The string '01234567'.

string.hexdigits

string.hexdigits The string '0123456789abcdefABCDEF'.

string.Formatter.vformat()

vformat(format_string, args, kwargs) This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the dictionary as individual arguments using the *args and **kwargs syntax. vformat() does the work of breaking up the format string into character data and replacement fields. It calls the various methods described below.