On 12/12/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote:

At 10:11 AM 12/12/2006 -0800, Thomas Wouters wrote:


>On 12/12/06, Jim Jewett
><<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]> wrote:
>>On 12/8/06, Guido van Rossum <<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]>
>>wrote:
>> > I've been thinking about this too, and I think it's reasonable to let
>> > the metaclass provide the dict to be used as locals.
>
>I do wonder about this though: will it require a particular type (like a
>dict)? The current code uses fast locals,

Uh, wha?  Did this change in Py3K?  Python 2.x doesn't do this and can't
do
it without introducing backward incompatibility.  In 2.x, class bodies do
NOT use fast locals, any more than module bodies do.

In any case, the performance within the class suite isn't especially
important; it's rare that there are any loops within a class body, or that
one creates classes within frequently-executed loops.


I apologize. It doesn't use STORE_LOCAL. It is, however, executed as a
normal function, and uses STORE_NAME. So the impact would be limited to that
of changing a function's non-fast locals from a dict to an arbitrary mapping
type. (Provided we don't specialcase class creation.)

I do wonder why classes don't use fast locals, though. 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... but I agree that it doesn't really
matter.

--
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to