Re:Advanced Python Mastery – A Course by David Beazley
by nicwolff on Wednesday July 19, 2023 @11:13AM
(#36787803)
Whenever you see this pattern, think of using a generator instead:
Now you can call read_portfolio() to get an iterable that lazily reads the file and yields dicts:
[ Parent
| on HN ]
Re:Advanced Python Mastery – A Course by David Beazley
by drexlspivey on Wednesday July 19, 2023 @11:21AM
(#36787921)
or use the built-in csv.DictReader :)