Kaydet (Commit) 354bffae authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Update comment to reflect using the default parameter with min() and max().

üst badf5d83
......@@ -464,7 +464,7 @@ def nsmallest(n, iterable, key=None):
Equivalent to: sorted(iterable, key=key)[:n]
"""
# Short-cut for n==1 is to use min() when len(iterable)>0
# Short-cut for n==1 is to use min()
if n == 1:
it = iter(iterable)
sentinel = object()
......@@ -527,7 +527,7 @@ def nlargest(n, iterable, key=None):
Equivalent to: sorted(iterable, key=key, reverse=True)[:n]
"""
# Short-cut for n==1 is to use max() when len(iterable)>0
# Short-cut for n==1 is to use max()
if n == 1:
it = iter(iterable)
sentinel = object()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment