[Python-Dev] LOAD_NAME & classes
Patrick K. O'Brien
pobrien@orbtech.com
Tue, 23 Apr 2002 11:18:52 -0500
[Guido van Rossum]
> Why is the fact that this works:
>
> x = 12
> def f():
> print x
>
> a "fortunate" side effect? That's how the language works!
Yes. I got a fresh cup of coffee and smashed my head against a wall and now
my mental processes appear to be working again. At least, there's more
squeaking and rattling. My previous choice of words now appears to be
rather... unfortunate. <wink>
> I think you've got it backwards. My complaint is that if f() above
> eventually grew 150 lines of unrelated code ending with an unrelated
> assignment to a local variable x, the breakage would show up at an
> unexpected point. Except for this one, it's hard to make a change at
> the *tail* of a function that breaks something at the beginning!
Yes, I don't know what I was thinking. Maybe I need a donut. Thanks.
---
Patrick K. O'Brien
Orbtech