Peng Yu wrote:
On Tue, Sep 27, 2016 at 10:01 AM, Chris Angelico <ros...@gmail.com> wrote:
"""In some languages, the variable bindings contained in a closure
behave just like any other variables. Alas, in python they are
read-only."""

This is not true, at least as of Python 3.
So in Python 2, this is true?
Python 2 doesn't have "nonlocal", so a nested function can't
rebind variables in an intermediate scope (between local and
module-level).

Of course, anything is changeable if you resort to sufficient
amounts of hackery. In this case I believe the hacking level
required involves ctypes.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to