Why we will use obj$func() often
Greg Ewing
greg at cosc.canterbury.ac.nz
Mon Apr 26 20:47:56 EDT 2004
Mark Hahn wrote:
> You cannot. Yes it literally means the immediately surrounding function.
> In your example, I can't think of any scheme we've discussed that accesses x
> in function f. Python surely cannot.
Python can't write to it, but at least it can read it.
Prothon apparently can't even read it.
> As always, I'm open to suggestions...
I can't think of any way to fix this that preserves the
single-pass requirement, short of introducing some kind
of declaration in the scope where the variable is defined.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list