summaryrefslogtreecommitdiff
path: root/Lib/pprint.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-12-22 21:52:32 +0000
committerFred Drake <fdrake@acm.org>1999-12-22 21:52:32 +0000
commitc1103d50a23e8aeaac242ecc1a99898d64fc7c7d (patch)
treec3b2769af993ddc4b37432479aff81030dc88068 /Lib/pprint.py
parentfe4b4a076919af5dc59cc379ec1202646989da3c (diff)
downloadcpython-c1103d50a23e8aeaac242ecc1a99898d64fc7c7d.tar.gz
Don't call len() if the value is already cached! Caught by Gerrit
Holl <gerrit.holl@pobox.com>.
Diffstat (limited to 'Lib/pprint.py')
-rw-r--r--Lib/pprint.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py
index 6704f9b23f..346c70b3c2 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,