[Python-Dev] Re: Object finalization for local (ie function) scopes

Oliver Schoenborn oliver.schoenborn at utoronto.ca
Tue Jun 15 07:14:38 EDT 2004


From: "Paul Moore" <pf_moore at yahoo.co.uk>
> "Oliver Schoenborn" <oliver.schoenborn at utoronto.ca> writes:
>
> Can you enumerate precisely how your proposal differs from PEP 310?
> [...]
> In summary, I see PEP 310 as a cleaner, more explicit, less magical
> variation of your proposal. (Of course, I would!)

In my original post, I didn't have 310 in mind, in the sense that,
naturally, an extension built right into the language (what 310 proposes) is
going to be better than one that "wraps" and "rebinds", so I wasn't
proposing something "better". Actually, my original post just asked if my
technique could be implemented in the interpreter directly. Nothing more.

So how about forgetting about it and focus on the good summary in Jim's
post. Scope.py was just an exploration of alternatives on my part and I
don't think it is worth pursuing on python-dev.

> If you could take your proposal, and tease out the reasons why you
> feel that PEP 310 does not satisfy the need you have, which your
> proposal does, and list those reasons in a way that could be added to
> PEP 310 (possibly as limitations, possibly as open questions, or
> possibly even as proposed extensions) then that would be great.

My only problem with PEP 310 is that the solution it proposes doesn't
address the problem that the user of a class still needs to be the one to
take care of ordering cleanup. So I would have prefered something that the
coder of a class uses to tell the interpreter "any instance of this object
needs deterministic cleanup", so the user can just be carefree when using
that class.

This problem is summarized well in Jim's last post, and if there is interest
I think that's what I'd like to focus on, and forget about my original post
(of course, I don't mind continuing the discussion about the implementation
of scope.py offlist).

Oliver




More information about the Python-Dev mailing list