On 3/15/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> At 06:26 PM 3/14/2007 -0700, Guido van Rossum wrote:
> >(It's a slightly
> >different function than currently; the current function *returns* the
> >locals, while the new one *takes* the locals as an argument; instead
> >of a LOAD_LOCALS opcode we need a STORE_LOCALS opcode.)
>
> Wouldn't it suffice to exec a code object with the specified locals?  Then
> the class suite wouldn't even need to be a function, since it would neither
> accept parameters nor return results.  And no new opcode would be needed.

This was brought up twice now, and I initially drafted it that way,
but then I started to think about closures and after looking at the
byte code for a class whose methods reference closures I realized that
making it a function is necessary to pass the closures in. Unless
there's a different way to deal with closures at the C level.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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

Reply via email to