Re: Accessing Python parse trees

2005-03-05 Thread Manlio Perillo
On Sat, 05 Mar 2005 08:52:38 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: >Manlio Perillo wrote: >> 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

Re: Accessing Python parse trees

2005-03-05 Thread Steve Holden
Manlio Perillo wrote: 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 'limit

Re: Accessing Python parse trees

2005-03-05 Thread Kent Johnson
Manlio Perillo wrote: 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 cl

Re: Accessing Python parse trees

2005-03-05 Thread Manlio Perillo
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 curre

Re: Accessing Python parse trees

2005-03-03 Thread Lonnie Princehouse
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: 1. Use introspection to have your on_parsing function locate the and parse the code being executed. I'm not sure if