diff options
author | Raymond Hettinger <python@rcn.com> | 2014-11-15 18:58:58 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-11-15 18:58:58 (GMT) |
commit | a34cd0c781d8e6581fdb4927560f81b594e29f1d (patch) | |
tree | ab4843b09a526cf3c20aebc6bb891298843ff8d0 /Lib/reprlib.py | |
parent | 5d438339822e9ae660940fe0ed009e7253d0a2a4 (diff) | |
download | cpython-a34cd0c781d8e6581fdb4927560f81b594e29f1d.zip cpython-a34cd0c781d8e6581fdb4927560f81b594e29f1d.tar.gz cpython-a34cd0c781d8e6581fdb4927560f81b594e29f1d.tar.bz2 |
Issue #22824: Simplify reprlib output format for empty arrays
Diffstat (limited to 'Lib/reprlib.py')
-rw-r--r-- | Lib/reprlib.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/reprlib.py b/Lib/reprlib.py index 5eb5ca3..ecbd2cc 100644 --- a/Lib/reprlib.py +++ b/Lib/reprlib.py @@ -83,6 +83,8 @@ class Repr: return self._repr_iterable(x, level, '[', ']', self.maxlist) def repr_array(self, x, level): + if not x: + return "array('%s')" % x.typecode header = "array('%s', [" % x.typecode return self._repr_iterable(x, level, header, '])', self.maxarray) |