classification
Title: csv readers and writers should be context managers
Type: enhancement Stage: resolved
Components: Library (Lib) Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: djc, r.david.murray
Priority: normal Keywords:

Created on 2011-02-04 09:39 by djc, last changed 2011-02-04 13:44 by r.david.murray. This issue is now closed.

Messages (2)
msg127876 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2011-02-04 09:39
The context managers should simply forward to the underlying file object.
msg127887 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-02-04 13:44
There is no underlying file object.  I presume you mean the reader/writer object?  Which have no close method, so there is no point in making them a context manager.  There is zero benefit and positive cost (an additional nesting level).  Just use with to open the file you then wrap in a reader/writer instance.
History
Date User Action Args
2011-02-04 13:44:23r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg127887

resolution: rejected
stage: resolved
2011-02-04 09:40:02djcsettype: enhancement
versions: - Python 2.6
2011-02-04 09:39:23djccreate