mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#5341: fix typo and adapt docstring syntax.
This commit is contained in:
parent
4fabac545e
commit
ea56710cda
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ def wraps(wrapped,
|
||||||
assigned=assigned, updated=updated)
|
assigned=assigned, updated=updated)
|
||||||
|
|
||||||
def total_ordering(cls):
|
def total_ordering(cls):
|
||||||
'Class decorator that fills-in missing ordering methods'
|
"""Class decorator that fills in missing ordering methods"""
|
||||||
convert = {
|
convert = {
|
||||||
'__lt__': [('__gt__', lambda self, other: other < self),
|
'__lt__': [('__gt__', lambda self, other: other < self),
|
||||||
('__le__', lambda self, other: not other < self),
|
('__le__', lambda self, other: not other < self),
|
||||||
|
@ -78,7 +78,7 @@ def total_ordering(cls):
|
||||||
return cls
|
return cls
|
||||||
|
|
||||||
def cmp_to_key(mycmp):
|
def cmp_to_key(mycmp):
|
||||||
'Convert a cmp= function into a key= function'
|
"""Convert a cmp= function into a key= function"""
|
||||||
class K(object):
|
class K(object):
|
||||||
def __init__(self, obj, *args):
|
def __init__(self, obj, *args):
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue