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), @@ -78,7 +77,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 diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -90,7 +90,7 @@ Library - collections.Counter() now supports a subtract() method. - the functools module now has a total_ordering() class decorator - to simplify the specifyication of rich comparisons. + to simplify the specification of rich comparisons. - The functools module also adds cmp_to_key() as a tool to transition old-style comparison functions to new-style key-functions.