
Sept. 5, 2021
7:10 p.m.
On 6/09/21 3:07 am, C. Titus Brown via Python-ideas wrote:
with csv.DictReader.open(filename) as r: for row in r: …
You can do this now: from contextlib import closing with closing(csv.DictReader.open(filename)) as r: ... IMO this is preferable than going around adding context manager methods to everything that has open-like functionality. -- Greg