From 354bffaec46367313d308c229f16094be4f74b19 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 15 Jun 2014 14:40:18 -0700 Subject: [PATCH] Update comment to reflect using the default parameter with min() and max(). --- Lib/heapq.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/heapq.py b/Lib/heapq.py index 8fb3d0921c2..258c0baeb62 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()