mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
#14603: use a listcomp in ZipFile.namelist.
This commit is contained in:
parent
578393b286
commit
006917ec7f
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue