What's up with rebinding assignment?
cben at techunix.technion.ac.il
Sun Mar 23 17:56:00 CET 2003
John Roth wrote on 2003-03-21:
> Two (or maybe three) thoughts.
> 1. I'd be very strongly against it, unless it was limited to static
Yes, yes, yes, of course not dynamic, what am I crazy <wink>?
> I can think of uses for this, but allowing any function to modify
> variables further up in the calling chain promiscuously is asking
> for trouble. Limiting it to static scope reduces the possibility of
> it causing trouble. That does, of course, mean that it could only be
> used in an embedded function, and that the embedded function
> couldn't be passed out to the caller.
The very same variables that you can currently read from nested
scopes. I'll make this explicit if I write a PEP.
> 2. I'm not certain I like the syntax.
No problem, I'm open on this :-). The first question is whether the
ability should be there.
> 3. I like the notion of an abbreviated notation for rebinding things
> at the instance or module level, however.
Not instance - if you mean getting rid of ``self.`` - that wouldn't
fit in here.
Beni Cherniavsky <cben at tx.technion.ac.il>,
whose 12x CD burner works at 24x with cdrecord in linux - sheer magic!
More information about the Python-list