[Python-Dev] PEP 340: Deterministic Finalisation (new PEP draft, either a competitor or update to PEP 340)
Eric Nieuwland
eric.nieuwland at xs4all.nl
Sun May 8 11:46:45 CEST 2005
Josiah Carlson wrote:
> Eric Nieuwland <eric.nieuwland at xs4all.nl> wrote:
>> I don't know. Using 'del' in that place seems ackward to me.
>> Why not use the following rule:
>> for [VAR in] EXPR:
>> SUITE
>> If EXPR is an iterator, no finalisation is done.
>> If EXPR is not an iterator, it is created at the start and destroyed
>> at
>> the end of the loop.
>
> You should know why that can't work. If I pass a list, is a list an
> iterator? No, but it should neither be created nor destroyed before or
> after.
I suggested to create AN ITERATOR FOR THE LIST and destroy that at the
end. The list itself remains untouched.
--eric
More information about the Python-Dev
mailing list