[Python-ideas] Deterministic iterator cleanup

Paul Moore p.f.moore at gmail.com
Fri Oct 21 06:07:46 EDT 2016


On 21 October 2016 at 10:53, Steven D'Aprano <steve at pearwood.info> wrote:
> On Wed, Oct 19, 2016 at 12:33:57PM -0700, Nathaniel Smith wrote:
>
>> I should also say, regarding your specific example, I guess it's an
>> open question whether we would want list_iterator.__iterclose__ to
>> actually do anything. It could flip the iterator to a state where it
>> always raises StopIteration,
>
> That seems like the most obvious.

So - does this mean "unless you understand what preserve() does,
you're OK to not use it and your code will continue to work as
before"? If so, then I'd be happy with this.

But I genuinely don't know (without going rummaging through docs) what
that statement means in any practical sense.
Paul


More information about the Python-ideas mailing list