Why read-only nested scopes?
David Eppstein
eppstein at ics.uci.edu
Wed Sep 4 17:24:42 EDT 2002
In article <m7ncnugbkm0qghf66qcub6e37b64fesdkq at 4ax.com>,
Gonçalo Rodrigues <op73418 at mail.telepac.pt> wrote:
> Anyway, I've been directed to PEP 227, cheerfully obeyed, and from what
> I have understood having read-only nested scopes was more of a design
> decision than something else. And while I can live happily with the
> decision (some would even say happier) there is something about the "You
> can look at it but not touch it" attitude that I dislike ;-)
I'm sure there were good reasons for this decision, but it leads to ugly
workarounds like making each nonlocal variable into a list and assigning
to x[0] instead of x...
--
David Eppstein UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/
More information about the Python-list
mailing list