diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -42,7 +42,7 @@ The :mod:`functools` module defines the .. function:: total_ordering(cls) Given a class defining one or more rich comparison ordering methods, this - class decorator supplies the rest. This simplies the effort involved + class decorator supplies the rest. This simplifies the effort involved in specifying all of the possible rich comparison operations: The class must define one of :meth:`__lt__`, :meth:`__le__`, diff --git a/Lib/functools.py b/Lib/functools.py --- a/Lib/functools.py +++ b/Lib/functools.py @@ -1,5 +1,4 @@ -"""functools.py - Tools for working with functions and callable objects -""" +"""Tools for working with functions and callable objects""" # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. @@ -16,8 +15,8 @@ WRAPPER_ASSIGNMENTS = ('__module__', '__ WRAPPER_UPDATES = ('__dict__',) def update_wrapper(wrapper, wrapped, - assigned = WRAPPER_ASSIGNMENTS, - updated = WRAPPER_UPDATES): + assigned=WRAPPER_ASSIGNMENTS, + updated=WRAPPER_UPDATES): """Update a wrapper function to look like the wrapped function wrapper is the function to be updated @@ -37,8 +36,8 @@ def update_wrapper(wrapper, return wrapper def wraps(wrapped, - assigned = WRAPPER_ASSIGNMENTS, - updated = WRAPPER_UPDATES): + assigned=WRAPPER_ASSIGNMENTS, + updated=WRAPPER_UPDATES): """Decorator factory to apply update_wrapper() to a wrapper function Returns a decorator that invokes update_wrapper() with the decorated @@ -51,7 +50,7 @@ def wraps(wrapped, assigned=assigned, updated=updated) def total_ordering(cls): - 'Class decorator that fills-in missing ordering methods' + """Class decorator that fills in missing ordering methods""" convert = { '__lt__': [('__gt__', lambda self, other: other < self), ('__le__', lambda self, other: not other < self), @@ -77,7 +76,7 @@ def total_ordering(cls): return cls def cmp_to_key(mycmp): - 'Convert a cmp= function into a key= function' + """Convert a cmp= function into a key= function""" class K(object): def __init__(self, obj, *args): self.obj = obj