python terminology on classes

Terry Reedy tjreedy at udel.edu
Wed Jul 28 18:16:18 EDT 2010


On 7/27/2010 1:28 PM, John Nagle wrote:

> Python 2.6 has a recently added "with" clause, borrowed from
> LISP, for associating actions with scopes. This is supported for
> files and locks, but setting your own object up for "with"
> requires adding special methods to the object. "with" is less
> convenient and more limited than RAII, but that's the direction
> Python is going. This may be in preparation for a move to a real
> garbage collector.

I do not remember that being stated as part of the rationale for 'with', 
but just today someone noted that since 'with' replace most uses of 
deterministic refcount gc, there is not more scope for changing things, 
at least for builtin and user classes, as opposed to C-extension classes.

-- 
Terry Jan Reedy




More information about the Python-list mailing list