At 11:07 AM 12/12/2006 -0800, Thomas Wouters wrote:
>I do wonder why classes don't use fast locals, though.
Because fast locals were an optimization added for functions. Before that,
there was no such thing as fast locals: everything used dictionaries.
>Building the locals dict from the fast locals at the end of the class
>suite execution seems more logical to me than what happens now...
Well, code that does things like this:
def some_func(an_ob, whatever):
...
class Foo:
some_func = some_func
Wouldn't work any more if you switched to fast locals. Whether you
consider that a good thing or a bad thing depends on your perspective, I
suppose. Some people complain that the above pattern doesn't work in
functions, due to the existence of fast locals. (I'm not one of them,
however.)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com