Why we will use obj$func() often
mark at prothon.org
Tue Apr 27 22:13:25 CEST 2004
Greg Ewing wrote:
> On the other hand, replacing it with a keyword such
> as "outer" would make it highly suggestive, to the
> point where I'd wager most people wouldn't have to
> look it up at all.
What do you mean by keyword? Which do you mean?
1) outer x # x is declared to come from outer scope
2) outer.x # outer is prefix replacing &
Form 1 is very non-P*thonic. I was happy to get rid of the global keyword
and I'd hate to see this one show up.
Form 2 would cause more confusion than &var because the reader would just
think it was a local variable and not even think to look it up. At least
the &var would signal that something unusual was happening.
Is there a third usage you mean that I'm missing?
More information about the Python-list