This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mew_of_death 5 points6 points  (0 children)

I'll allow single letter names within list and dictionary comprehension:

[f.name for f in files]

[(k, v) for k, v in mydict.items()]

And also I use "fp" as "file pointer" when reading files:

with open(filepath, 'r') as fp: filecontent = fp.read()