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

This commit is contained in:
Raymond Hettinger 2014-06-15 14:40:18 -07:00
parent badf5d839d
commit 354bffaec4
1 changed files with 2 additions and 2 deletions

View File

@ -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()