From 006917ec7fde087d7fe0e06858c8bce45314e5b8 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Mon, 16 Apr 2012 21:34:24 -0600 Subject: [PATCH] #14603: use a listcomp in ZipFile.namelist. --- Lib/zipfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 435a3e95cb9..406996d9620 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