Message341258
Ok, I think it's reasonable to make the resource management explicit for the specific case of letting iterparse() open the file. That suggests that there should also be context manager support, given that safe usages would often involve a try-finally.
Since it might not always be obvious for users when they need to close the iterator or not, I would also suggest to not let it raise an error on a double-close, i.e. if .close() was already called or the iterator was already exhausted (and the file closed automatically), calling .close() should just do nothing. |
|
Date |
User |
Action |
Args |
2019-05-02 08:32:19 | scoder | set | recipients:
+ scoder, serhiy.storchaka, abarry |
2019-05-02 08:32:19 | scoder | set | messageid: <1556785939.9.0.406189554748.issue25707@roundup.psfhosted.org> |
2019-05-02 08:32:19 | scoder | link | issue25707 messages |
2019-05-02 08:32:19 | scoder | create | |
|