Message258233
I definitely support adding a close() method, and a ResourceWarning if the iterator is not exhausted when it is deallocated. Adding context manager support is probably worthwhile as well, though there is one disadvantage: it would be hard to implement scandir() as a plain generator, because generators don’t support the context manager protocol. But C Python’s implementation is in C, and even in native Python you could implement it as a custom iterator class.
I suggest using this issue for adding the new API(s), presumably to 3.6 only, and Issue 26111 for adding a warning to the existing 3.5 documentation. |
|
Date |
User |
Action |
Args |
2016-01-14 22:14:16 | martin.panter | set | recipients:
+ martin.panter, gvanrossum, vstinner, benhoyt, serhiy.storchaka |
2016-01-14 22:14:16 | martin.panter | set | messageid: <1452809656.09.0.116484964328.issue25994@psf.upfronthosting.co.za> |
2016-01-14 22:14:16 | martin.panter | link | issue25994 messages |
2016-01-14 22:14:15 | martin.panter | create | |
|