From: Raymond Hettinger Date: Sun, 15 Jun 2014 21:40:18 +0000 (-0700) Subject: Update comment to reflect using the default parameter with min() and max(). X-Git-Tag: v3.5.0a1~1443^2~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=354bffaec46367313d308c229f16094be4f74b19;p=python Update comment to reflect using the default parameter with min() and max(). --- diff --git a/Lib/heapq.py b/Lib/heapq.py index 8fb3d0921c..258c0baeb6 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py @@ -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()