On 3 Mar 2005 11:15:28 -0800, "Lonnie Princehouse"
<[EMAIL PROTECTED]> wrote:

>No.  I don't think it's possible to read the parse tree used by the
>interpreter, especially as it is being created. Here are a couple of
>kludgy ideas that might come close, though:

Is this a 'limitation' of the current version or it is impossible for
the architecture of CPython?
What about pypy?

>
>On a side note, check out the compiler module.  You might find it to be
>friendlier and more useful than parser.

Thanks for the hint. It is what I want.
Unfortunately is seem to be not well documented.


Anyway, here is an example of what I would like to do:

#begin
def foo(**kwargs): print kwargs

foo(a = 1, b = 2, c = 3)
#end


In the current implementation kwargs is a dict, but I need to have the
keyword argument sorted.
Unfortunately subclassing fron dict and installing the class in the
__builtin__ module (with the name 'dict') does not work, CPython uses
only builtin types.

With the compiler module I can obtain the keyword arguments in the
order the were specified.
The problem is how to do this for every call to foo!




Thanks and regards   Manlio Perillo
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to