summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-04-17 03:34:24 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-04-17 03:34:24 (GMT)
commit006917ec7fde087d7fe0e06858c8bce45314e5b8 (patch)
tree82df4b5b63b6119de4101bdf830e7f103fd7155c /Lib/zipfile.py
parent578393b2862173d54baa32684812617b2e995412 (diff)
downloadcpython-006917ec7fde087d7fe0e06858c8bce45314e5b8.zip
cpython-006917ec7fde087d7fe0e06858c8bce45314e5b8.tar.gz
cpython-006917ec7fde087d7fe0e06858c8bce45314e5b8.tar.bz2
#14603: use a listcomp in ZipFile.namelist.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 435a3e9..406996d 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -836,10 +836,7 @@ class ZipFile:
def namelist(self):
"""Return a list of file names in the archive."""
- l = []
- for data in self.filelist:
- l.append(data.filename)
- return l
+ return [data.filename for data in self.filelist]
def infolist(self):
"""Return a list of class ZipInfo instances for files in the