diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-09-22 12:43:16 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-09-22 12:43:16 (GMT) |
commit | e46d14cd2c92a7ec8287f8cf222a07de869081bf (patch) | |
tree | 224fd76a638c7dedbf9eb8c65816ba2fdaa48430 /Lib | |
parent | d7160f88455d9ff8d2c775ba7d52ca6f9907d90d (diff) | |
download | cpython-e46d14cd2c92a7ec8287f8cf222a07de869081bf.zip cpython-e46d14cd2c92a7ec8287f8cf222a07de869081bf.tar.gz cpython-e46d14cd2c92a7ec8287f8cf222a07de869081bf.tar.bz2 |
Avoid list as a variable name.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/gopherlib.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/gopherlib.py b/Lib/gopherlib.py index fee28bb..03801d0 100644 --- a/Lib/gopherlib.py +++ b/Lib/gopherlib.py @@ -95,7 +95,7 @@ def path_to_datatype_name(path): def get_directory(f): """Get a directory in the form of a list of entries.""" - list = [] + entries = [] while 1: line = f.readline() if not line: @@ -122,14 +122,14 @@ def get_directory(f): else: parts.append('') parts.insert(0, gtype) - list.append(parts) - return list + entries.append(parts) + return entries def get_textfile(f): """Get a text file as a list of lines, with trailing CRLF stripped.""" - list = [] - get_alt_textfile(f, list.append) - return list + lines = [] + get_alt_textfile(f, lines.append) + return lines def get_alt_textfile(f, func): """Get a text file and pass each line to a function, with trailing CRLF stripped.""" @@ -191,11 +191,11 @@ def test(): else: f = send_selector(selector, host) if type == A_TEXT: - list = get_textfile(f) - for item in list: print item + lines = get_textfile(f) + for item in lines: print item elif type in (A_MENU, A_INDEX): - list = get_directory(f) - for item in list: print item + entries = get_directory(f) + for item in entries: print item else: data = get_binary(f) print 'binary data:', len(data), 'bytes:', `data[:100]`[:40] |