diff options
author | Fred Drake <fdrake@acm.org> | 1999-12-22 21:52:32 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-12-22 21:52:32 (GMT) |
commit | fbff97a73bda8d38a80c84f9edb2efd05c1306a6 (patch) | |
tree | 189cd690f594b77f3cc3e7e2f28e5b8615dd4cc7 /Lib/pprint.py | |
parent | 8972dfd58eb7da25cf5129f82571003d3f7ab315 (diff) | |
download | cpython-fbff97a73bda8d38a80c84f9edb2efd05c1306a6.zip cpython-fbff97a73bda8d38a80c84f9edb2efd05c1306a6.tar.gz cpython-fbff97a73bda8d38a80c84f9edb2efd05c1306a6.tar.bz2 |
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.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py index 6704f9b..346c70b 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, |