Q: Python 2.0 preliminary features?

Greg Ewing greg.ewing at compaq.com
Mon Oct 11 05:07:21 EDT 1999


Tim Peters wrote:
> 
> Greg Ewing recently worked up a patch that implements "read only" lexical
> closures, that avoids the cycles in many (most, or almost all, for most, or
> almost all <wink>, common programming styles) cases, albeit with some other
> costs (see DejaNews).

I'd just like to point out that my closures are only "read only"
because I have deferred making a syntactic decision about how to declare
variables as "nonlocal" for assignment purposes; there's no inherent
reason why my closures couldn't be read-write.

Also, to clarify Tim's rather waffly characterisation of when my
closures do or don't cause cycles, it's quite simple: they never
cause cycles unless you write code which makes them do so. This
is no worse than the situation with regard to cycles everywhere
else in the language.

Caveat-generator-cycloramum,
Greg




More information about the Python-list mailing list