From: Fred Drake Date: Wed, 22 Dec 1999 21:52:32 +0000 (+0000) Subject: Don't call len() if the value is already cached! Caught by Gerrit X-Git-Tag: v1.6a1~586 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fbff97a73bda8d38a80c84f9edb2efd05c1306a6;p=thirdparty%2FPython%2Fcpython.git Don't call len() if the value is already cached! Caught by Gerrit Holl . --- diff --git a/Lib/pprint.py b/Lib/pprint.py index 6704f9b23f71..346c70b3c2da 100644 --- a/Lib/pprint.py +++ b/Lib/pprint.py @@ -141,7 +141,7 @@ class PrettyPrinter: 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,