From fbff97a73bda8d38a80c84f9edb2efd05c1306a6 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 22 Dec 1999 21:52:32 +0000 Subject: [PATCH] Don't call len() if the value is already cached! Caught by Gerrit Holl . --- Lib/pprint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pprint.py b/Lib/pprint.py index 6704f9b23f7..346c70b3c2d 100644 --- a/Lib/pprint.py +++ b/Lib/pprint.py @@ -141,7 +141,7 @@ def __format(self, object, stream, indent, allowance, context, level): indent = indent + self.__indent_per_level self.__format(object[0], stream, indent, allowance + 1, context, level) - if len(object) > 1: + if length > 1: for ent in object[1:]: stream.write(',\n' + ' '*indent) self.__format(ent, stream, indent,